MCPcopy Index your code
hub / github.com/riverqueue/river / NowOrNil

Method NowOrNil

rivertype/time_generator.go:27–27  ·  view source on GitHub ↗

NowOrNil returns the currently stubbed time if the current time is stubbed, and nil otherwise. This is mainly for database-facing test paths that want to inject a deterministic wall-clock timestamp when time is stubbed, but to fall back to a database-side time default in production.

()

Source from the content-addressed store, hash-verified

25 // deterministic wall-clock timestamp when time is stubbed, but to fall back
26 // to a database-side time default in production.
27 NowOrNil() *time.Time
28}

Callers 14

StartWorkContextMethod · 0.65
dispatchWorkMethod · 0.65
reportQueueStatusOnceMethod · 0.65
jobCancelMethod · 0.65
jobRetryMethod · 0.65
QueuePauseMethod · 0.65
QueuePauseTxMethod · 0.65
QueueResumeMethod · 0.65
QueueResumeTxMethod · 0.65
runFollowerStateMethod · 0.65
runLeaderStateMethod · 0.65

Implementers 3

UnStubbableTimeGeneratorrivershared/baseservice/base_service.g
TimeStubrivershared/riversharedtest/rivershare
localNowTimeGeneratorStubinternal/leadership/elector_test.go

Calls

no outgoing calls

Tested by

no test coverage detected