fix(gateway): 일시정지와 서버 중지 상태 계약 분리

This commit is contained in:
2026-08-15 17:12:13 +00:00
parent dc27766dd6
commit 4f841ad82f
16 changed files with 320 additions and 41 deletions
@@ -1,3 +1,4 @@
import { gatewayProfileCapabilities, type GatewayProfileStatus } from '@sammo-ts/common';
import { createGatewayPostgresConnector } from '@sammo-ts/infra';
export interface GatewayProfileGateOptions {
@@ -15,8 +16,6 @@ export interface GatewayProfileGate {
const DEFAULT_CACHE_MS = 2000;
const isRunningStatus = (status: string | null | undefined): boolean => status === 'RUNNING';
export const createGatewayProfileGate = async (options: GatewayProfileGateOptions): Promise<GatewayProfileGate> => {
const connector = createGatewayPostgresConnector({
url: options.gatewayDatabaseUrl ?? options.databaseUrl,
@@ -34,7 +33,7 @@ export const createGatewayProfileGate = async (options: GatewayProfileGateOption
if (!profile) {
return false;
}
return !isRunningStatus(profile.status);
return !gatewayProfileCapabilities(profile.status as GatewayProfileStatus).turnsRunning;
} catch {
return false;
}