MCPcopy Create free account
hub / github.com/DoNewsCode/core / GetCurrentSchedule

Function GetCurrentSchedule

cron/helper.go:14–22  ·  view source on GitHub ↗

GetCurrentSchedule returns the current schedule for the given context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

12
13// GetCurrentSchedule returns the current schedule for the given context.
14func 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.
25func GetNextSchedule(ctx context.Context) time.Time {

Callers 2

WithLoggingFunction · 0.85
TestGetCurrentScheduleFunction · 0.85

Calls 1

ValueMethod · 0.80

Tested by 1

TestGetCurrentScheduleFunction · 0.68