fix(gateway): 일시정지와 서버 중지 상태 계약 분리
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user