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 {
8181 originalLocation := now .Location ()
8282
8383 convertedTime := now .In (trigger .location )
84- newTime : = time .Date (convertedTime .Year (),
84+ convertedTime = time .Date (convertedTime .Year (),
8585 convertedTime .Month (),
8686 convertedTime .Day (),
8787 convertedTime .Hour (),
8888 convertedTime .Minute (),
8989 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 (),
91104 trigger .location )
92105
93- next := trigger .cronExpression .NextTime (newTime )
94106 return next .In (originalLocation )
95107}
You can’t perform that action at this time.
0 commit comments