Docker images / prepare-release (push) Successful in 10s
Docker images / backend-test (push) Successful in 2m2s
Docker images / frontend-image (push) Successful in 3m23s
Docker images / updater-image (push) Successful in 44s
Docker images / backend-image (push) Successful in 2m47s
Docker images / notify-webhook (push) Skipped
Docker images / publish-release (push) Successful in 11s
При первом рестарте wipe всех таблиц и импорт из SQLite в компактную схему. Retention через DROP PARTITION, lz4 и AIO worker. Co-authored-by: Cursor <[email protected]>
25 lines
760 B
TypeScript
25 lines
760 B
TypeScript
export const TRAFFIC_FLAG_RUNNING = 1
|
|
export const TRAFFIC_FLAG_DISABLED = 2
|
|
|
|
export function encodeTrafficFlags(running: boolean, disabled: boolean): number {
|
|
return (running ? TRAFFIC_FLAG_RUNNING : 0) | (disabled ? TRAFFIC_FLAG_DISABLED : 0)
|
|
}
|
|
|
|
export function trafficFlagRunning(flags: number | null | undefined): boolean {
|
|
return ((Number(flags) || 0) & TRAFFIC_FLAG_RUNNING) !== 0
|
|
}
|
|
|
|
export function trafficFlagDisabled(flags: number | null | undefined): boolean {
|
|
return ((Number(flags) || 0) & TRAFFIC_FLAG_DISABLED) !== 0
|
|
}
|
|
|
|
export function decodeTrafficSampleFlags(flags: number | null | undefined): {
|
|
running: boolean
|
|
disabled: boolean
|
|
} {
|
|
return {
|
|
running: trafficFlagRunning(flags),
|
|
disabled: trafficFlagDisabled(flags),
|
|
}
|
|
}
|