MCPcopy Create free account
hub / github.com/aptdnfapt/qwen-code-oai-proxy / initializeServerRuntime

Function initializeServerRuntime

src/server/lifecycle.ts:108–145  ·  view source on GitHub ↗
({
  host,
  port,
  qwenAPI,
  authService,
  runtimeConfigStore,
  accountRefreshScheduler,
  liveLogger,
  fileLogger,
  config,
}: {
  host: string;
  port: number;
  qwenAPI: any;
  authService: any;
  runtimeConfigStore: any;
  accountRefreshScheduler: any;
  liveLogger: any;
  fileLogger: any;
  config: any;
})

Source from the content-addressed store, hash-verified

106}
107
108export async function initializeServerRuntime({
109 host,
110 port,
111 qwenAPI,
112 authService,
113 runtimeConfigStore,
114 accountRefreshScheduler,
115 liveLogger,
116 fileLogger,
117 config,
118}: {
119 host: string;
120 port: number;
121 qwenAPI: any;
122 authService: any;
123 runtimeConfigStore: any;
124 accountRefreshScheduler: any;
125 liveLogger: any;
126 fileLogger: any;
127 config: any;
128}): Promise<void> {
129 await initializeRuntimeLogging(runtimeConfigStore, fileLogger);
130 liveLogger.serverStarted(host, port);
131 qwenAPI.authManager.init(qwenAPI);
132 fileLogger.startCleanupJob();
133
134 try {
135 await logAccountStatus({ qwenAPI, authService, config });
136 } catch {
137 console.log("\x1b[33mWarning: Could not load accounts\x1b[0m");
138 }
139
140 try {
141 await accountRefreshScheduler.initialize();
142 } catch (error: any) {
143 console.log(`\x1b[31mScheduler init failed: ${error.message}\x1b[0m`);
144 }
145}

Callers 1

startHeadlessServerFunction · 0.85

Calls 5

initializeRuntimeLoggingFunction · 0.85
logAccountStatusFunction · 0.85
initMethod · 0.80
startCleanupJobMethod · 0.80
initializeMethod · 0.45

Tested by

no test coverage detected