Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fopina committed Feb 11, 2024
1 parent f38f135 commit 2f6704b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dkron/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,11 @@ func (j *Job) GetTimeLocation() *time.Location {
// such as "0 0 H * * *"
func (j *Job) scheduleHash() string {
spec := j.Schedule
if strings.Contains(spec, "H") && strings.Count(strings.TrimSpace(spec), " ") == 5 {
expectedParts := 5
if strings.HasPrefix(spec, "TZ=") || strings.HasPrefix(spec, "CRON_TZ=") {
expectedParts = 6
}
if strings.Contains(spec, "H") && strings.Count(strings.TrimSpace(spec), " ") == expectedParts {
hash := 0
for _, c := range j.Name {
hash += int(c)
Expand Down

0 comments on commit 2f6704b

Please sign in to comment.