mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
proposition for new timing tags *minute and *hour to be used in action
plans on recurring charges. NOTE: minute interval executes every second minute but logs from the scheduler report execution every minute
This commit is contained in:
@@ -108,6 +108,8 @@ const (
|
||||
UNLIMITED = "*unlimited"
|
||||
ZERO = "*zero"
|
||||
ASAP = "*asap"
|
||||
MINUTE = "*minute"
|
||||
HOUR = "*hour"
|
||||
USERS = "*users"
|
||||
COMMENT_CHAR = '#'
|
||||
CSV_SEP = ','
|
||||
|
||||
@@ -102,5 +102,21 @@ func incrementalFormula(params map[string]interface{}) float64 {
|
||||
return units / DaysInYear(now.Year())
|
||||
}
|
||||
}
|
||||
if increment == "hour" {
|
||||
if interval == "day" {
|
||||
return units / 24
|
||||
}
|
||||
if interval == "month" {
|
||||
return units / ( DaysInMonth(now.Year(), now.Month()) * 24 )
|
||||
}
|
||||
if interval == "year" {
|
||||
return units / ( DaysInYear(now.Year()) * 24 )
|
||||
}
|
||||
}
|
||||
if increment == "minute" {
|
||||
if interval == "hour" {
|
||||
return units / 60
|
||||
}
|
||||
}
|
||||
return 0.0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user