Documentation
¶
Index ¶
- Constants
- Variables
- func SetCancelWaitTimeout(d time.Duration)
- type ActionRow
- type ActionRowStatus
- type AsyncStatus
- func (status *AsyncStatus) Cancel(command string, err error) (string, error)
- func (status *AsyncStatus) CancelAll(cancelMsg string) []string
- func (status *AsyncStatus) CheckCommandInProgress(command string) bool
- func (status *AsyncStatus) GetContextWithCancel(commandId int) (context.Context, context.CancelFunc, error)
- func (status *AsyncStatus) GetStatus(current bool, filter string, last int) []ActionRowStatus
- func (status *AsyncStatus) GetStatusByOperationId(operationId string) []ActionRowStatus
- func (status *AsyncStatus) InProgress() bool
- func (status *AsyncStatus) Start(command string) (int, context.Context)
- func (status *AsyncStatus) StartWithOperationId(command string, operationId string) (int, context.Context)
- func (status *AsyncStatus) Stop(commandId int, err error)
Constants ¶
View Source
const ( InProgressStatus = "in progress" SuccessStatus = "success" CancelStatus = "cancel" ErrorStatus = "error" )
View Source
const NotFromAPI = int(-1)
Variables ¶
View Source
var CancelWaitTimeout = 1800 * time.Second
CancelWaitTimeout bounds how long Cancel/CancelAll wait for the command goroutine to return. After the timeout we give up and let the caller proceed (a stuck goroutine should not block /backup/kill forever). The default matches APIConfig.CancelOperationTimeout (1800s); the server overrides it from config on Restart/ReloadConfig.
View Source
var Current = &AsyncStatus{}
Functions ¶
func SetCancelWaitTimeout ¶ added in v2.7.0
SetCancelWaitTimeout updates the global CancelWaitTimeout. Safe to call from the API server when reloading config.
Types ¶
type ActionRow ¶
type ActionRow struct {
ActionRowStatus
Ctx context.Context
Cancel context.CancelFunc
// Done is closed by Stop when the command goroutine has fully returned.
// Cancel/CancelAll wait on this so callers know the operation really
// finished (e.g. defers like pidlock.RemovePidFile have already run).
Done chan struct{}
}
type ActionRowStatus ¶
type AsyncStatus ¶
func (*AsyncStatus) Cancel ¶
func (status *AsyncStatus) Cancel(command string, err error) (string, error)
func (*AsyncStatus) CancelAll ¶
func (status *AsyncStatus) CancelAll(cancelMsg string) []string
func (*AsyncStatus) CheckCommandInProgress ¶
func (status *AsyncStatus) CheckCommandInProgress(command string) bool
func (*AsyncStatus) GetContextWithCancel ¶
func (status *AsyncStatus) GetContextWithCancel(commandId int) (context.Context, context.CancelFunc, error)
func (*AsyncStatus) GetStatus ¶
func (status *AsyncStatus) GetStatus(current bool, filter string, last int) []ActionRowStatus
func (*AsyncStatus) GetStatusByOperationId ¶ added in v2.6.30
func (status *AsyncStatus) GetStatusByOperationId(operationId string) []ActionRowStatus
func (*AsyncStatus) InProgress ¶
func (status *AsyncStatus) InProgress() bool
InProgress any .Status == InProgressStatus command shall return true, https://github.com/Altinity/clickhouse-backup/issues/827
func (*AsyncStatus) StartWithOperationId ¶ added in v2.6.30
func (*AsyncStatus) Stop ¶
func (status *AsyncStatus) Stop(commandId int, err error)
Click to show internal directories.
Click to hide internal directories.