-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: introduce the more consistent and feature-rich create function #22
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
==========================================
- Coverage 99.48% 96.80% -2.68%
==========================================
Files 5 6 +1
Lines 584 658 +74
==========================================
+ Hits 581 637 +56
- Misses 3 21 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Features
Comprehensive Documentation: Added extensive documentation using
?MODULEDOC
and?DOC
macros to explain the module's purpose, functions, parameters, and return values. This includes:ecron
.create/3
,create/4
,send_after/3
,send_interval/2
,send_interval/3
,send_interval/4
,delete/1
,delete/2
,deactivate/1
,activate/1
,deactivate/2
,activate/2
,statistic/0
,statistic/1
,statistic/2
,predict_datetime/2
,predict_datetime/4
,reload/0
,reload/1
, andparse_spec/2
.Deprecated Functions: Marked older functions (
add/3
,add/4
,add/6
,add/7
,add_with_time/5
,add_with_time/6
,add_with_count/3
,add_with_count/5
,send_interval/5
,send_interval/7
,send_interval/8
) as deprecated, advising users to usecreate/4
andsend_interval/4
instead.Enhanced
create/4
Function:Opts
parameter, includingregister
,start_time
,end_time
,singleton
,max_count
, andmax_runtime_ms
.max_count
is reached.TimeRange
info box explaining the constraints onstart_time
andend_time
.Enhanced
send_interval/4
Function:statistic/0
results.ecron:delete/1
should be used to cancel the timer, noterlang:cancel_timer/1
.Enhanced
statistic/2
Function:statistic()
return value, including descriptions ofok
,crashed
,skipped
, andaborted
states.Time Zone Configuration:
time_zone
application environment variable.local
andutc
time zone settings.Telemetry Integration:
success
,activate
,deactivate
,delete
,crashed
,skipped
,aborted
,global,up
, andglobal,down
.log
configuration.Internal Functions:
?DOC(false)
to internal functions to hide them from the generated documentation.Changes
Refactored
add
Functions: Replaced multipleadd
functions with a unifiedcreate
function for better consistency and maintainability.Improved Error Handling: Added more specific error handling and return values for various functions.
Code Clarity: Improved code readability by adding comments and using more descriptive variable names.
Deprecations
add/3
,add/4
,add/6
,add/7
add_with_time/5
,add_with_time/6
add_with_count/3
,add_with_count/5
send_interval/5
,send_interval/7
,send_interval/8
Purpose
These changes significantly enhance the usability and maintainability of the
ecron
library by providing comprehensive documentation, improving code structure, and integrating Telemetry for better monitoring and logging. The deprecation of older functions encourages users to adopt the more consistent and feature-richcreate
function.