Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerLockService ¶
type ServerLockService struct { SQLStore *sqlstore.SqlStore `inject:""` // contains filtered or unexported fields }
ServerLockService allows servers in HA mode to claim a lock and execute an function if the server was granted the lock
func (*ServerLockService) LockAndExecute ¶
func (sl *ServerLockService) LockAndExecute(ctx context.Context, actionName string, maxInterval time.Duration, fn func()) error
LockAndExecute try to create a lock for this server and only executes the `fn` function when successful. This should not be used at low internal. But services that needs to be run once every ex 10m.
Click to show internal directories.
Click to hide internal directories.