mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-23 16:34:27 +00:00
🧑🏭 fix: Initialize Remote SDK Hosts in Cluster Workers (#18519)
This commit is contained in:
parent
81c2dac327
commit
6aa1c94cd6
2 changed files with 19 additions and 0 deletions
|
|
@ -61,6 +61,8 @@ const {
|
|||
startCodeEnvironmentLifecycleReconciler,
|
||||
waitForKeyvRedisClient,
|
||||
createCodeApiUploadRegistry,
|
||||
createSdkFileHost,
|
||||
createSdkModelHost,
|
||||
cacheConfig,
|
||||
createClusteredFileSweep,
|
||||
createRequestSanitizer,
|
||||
|
|
@ -545,6 +547,8 @@ if (cluster.isMaster) {
|
|||
}),
|
||||
{ priority: 50 },
|
||||
);
|
||||
app.locals.sdkFileHost = createSdkFileHost(appConfig?.endpoints?.agents?.sdkHostFiles);
|
||||
app.locals.sdkModelHost = createSdkModelHost(appConfig?.endpoints?.agents?.sdkHostModels);
|
||||
initializeFileStorage(appConfig);
|
||||
initializeGitHubSkillSync(appConfig);
|
||||
startSkillDeletionSweep(appConfig.skillDeletion);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,21 @@ describe('Experimental server configuration', () => {
|
|||
expect(listenIndex).toBeLessThan(timeoutConfigIndex);
|
||||
});
|
||||
|
||||
it.each([
|
||||
['File', 'Files'],
|
||||
['Model', 'Models'],
|
||||
])('installs the SDK %s host from base config before serving requests', (host, setting) => {
|
||||
const configIndex = source.indexOf('await getAppConfig({ baseOnly: true });');
|
||||
const binding = `app.locals.sdk${host}Host = createSdk${host}Host(appConfig?.endpoints?.agents?.sdkHost${setting});`;
|
||||
const bindingIndex = source.indexOf(binding);
|
||||
const listenIndex = source.indexOf('const server = app.listen');
|
||||
|
||||
expect(configIndex).toBeGreaterThan(-1);
|
||||
expect(bindingIndex).toBeGreaterThan(configIndex);
|
||||
expect(listenIndex).toBeGreaterThan(bindingIndex);
|
||||
expect(source.indexOf(binding, bindingIndex + 1)).toBe(-1);
|
||||
});
|
||||
|
||||
it('lets each worker drain registered services before cluster shutdown', () => {
|
||||
const listenIndex = source.indexOf('const server = app.listen');
|
||||
const gracefulShutdownIndex = source.indexOf('setupGracefulShutdown(server);');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue