File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -81,15 +81,27 @@ func (trigger *CronTrigger) NextExecutionTime(ctx TriggerContext) time.Time {
81
81
originalLocation := now .Location ()
82
82
83
83
convertedTime := now .In (trigger .location )
84
- newTime : = time .Date (convertedTime .Year (),
84
+ convertedTime = time .Date (convertedTime .Year (),
85
85
convertedTime .Month (),
86
86
convertedTime .Day (),
87
87
convertedTime .Hour (),
88
88
convertedTime .Minute (),
89
89
convertedTime .Second (),
90
- 0 ,
90
+ convertedTime .Nanosecond (),
91
+ trigger .location )
92
+
93
+ next := trigger .cronExpression .NextTime (convertedTime )
94
+
95
+ // there is a bug causes timezone changing when an operation is performed on time value like add, subtraction
96
+ // to resolve this issue, we use a workaround solution
97
+ next = time .Date (next .Year (),
98
+ next .Month (),
99
+ next .Day (),
100
+ next .Hour (),
101
+ next .Minute (),
102
+ next .Second (),
103
+ next .Nanosecond (),
91
104
trigger .location )
92
105
93
- next := trigger .cronExpression .NextTime (newTime )
94
106
return next .In (originalLocation )
95
107
}
You can’t perform that action at this time.
0 commit comments