refactor(server): standalone runtime module (#9120)

This commit is contained in:
forehalo
2024-12-13 06:27:14 +00:00
parent 4c23991047
commit 81c68032e1
18 changed files with 85 additions and 75 deletions

View File

@@ -1,6 +1,6 @@
import { Injectable, Logger } from '@nestjs/common';
import { Config, type EventPayload, OnEvent } from '../../base';
import { type EventPayload, OnEvent, Runtime } from '../../base';
import { UserService } from '../user/service';
import { FeatureService } from './service';
import { FeatureType } from './types';
@@ -19,7 +19,7 @@ export class FeatureManagementService {
constructor(
private readonly feature: FeatureService,
private readonly user: UserService,
private readonly config: Config
private readonly runtime: Runtime
) {}
// ======== Admin ========
@@ -95,7 +95,7 @@ export class FeatureManagementService {
email: string,
type: EarlyAccessType = EarlyAccessType.App
) {
const earlyAccessControlEnabled = await this.config.runtime.fetch(
const earlyAccessControlEnabled = await this.runtime.fetch(
'flags/earlyAccessControl'
);