GetCurrentSchedule returns the current schedule for the given context.
(ctx context.Context)
| 12 | |
| 13 | // GetCurrentSchedule returns the current schedule for the given context. |
| 14 | func GetCurrentSchedule(ctx context.Context) time.Time { |
| 15 | if ctx == nil { |
| 16 | return time.Time{} |
| 17 | } |
| 18 | if t, ok := ctx.Value(prevContextKey).(time.Time); ok { |
| 19 | return t |
| 20 | } |
| 21 | return time.Time{} |
| 22 | } |
| 23 | |
| 24 | // GetNextSchedule returns the next schedule for the given context. |
| 25 | func GetNextSchedule(ctx context.Context) time.Time { |