fix(runtime): extend standalone service boot budget

This commit is contained in:
xixu-me committed 2026-03-30 22:34:06 +08:00
1 parent c5b0b9d84f
commit 4153beb619
8 files changed
+35

No files matched your search

+4
View File
@@ -188,6 +188,10 @@ export class CrawlerHost extends RPCHost {
this.emit('ready');
}
override dependencyReady(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS) {
return super.dependencyReady(timeoutMilliseconds);
}
async getIndex(auth?: AuthDTO) {
const indexObject: Record<string, string | number | undefined> = Object.create(indexProto);
Object.assign(indexObject, {
+4
View File
@@ -103,6 +103,10 @@ export class SearcherHost extends RPCHost {
this.emit('ready');
}
override dependencyReady(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS) {
return super.dependencyReady(timeoutMilliseconds);
}
@Method({
name: 'searchIndex',
ext: {
+4
View File
@@ -121,6 +121,10 @@ export class SerpHost extends RPCHost {
this.emit('ready');
}
override dependencyReady(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS) {
return super.dependencyReady(timeoutMilliseconds);
}
@Method({
name: 'searchIndex',
ext: {
+4
View File
@@ -37,6 +37,10 @@ export class GoogleSERP extends AsyncService {
this.emit('ready');
}
override dependencyReady(timeoutMilliseconds = SERP_BOOT_TIMEOUT_MS) {
return super.dependencyReady(timeoutMilliseconds);
}
@retryWith((err) => {
if (err instanceof ServiceBadApproachError) {
return false;
+4
View File
@@ -56,6 +56,10 @@ export class CrawlStandAloneServer extends KoaServer {
await super.init();
}
override dependencyReady(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS) {
return super.dependencyReady(timeoutMilliseconds);
}
async walkForAssets() {
const files = await FsWalk.walkOut(path.resolve(__dirname, '..', '..', 'public'));
+4
View File
@@ -63,6 +63,10 @@ export class SearchStandAloneServer extends KoaServer {
await super.init();
}
override dependencyReady(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS) {
return super.dependencyReady(timeoutMilliseconds);
}
async walkForAssets() {
const files = await FsWalk.walkOut(path.resolve(__dirname, '..', '..', 'public'));
+4
View File
@@ -64,6 +64,10 @@ export class SERPStandAloneServer extends KoaServer {
await super.init();
}
override dependencyReady(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS) {
return super.dependencyReady(timeoutMilliseconds);
}
async walkForAssets() {
const files = await FsWalk.walkOut(path.resolve(__dirname, '..', '..', 'public'));
@@ -88,10 +88,17 @@ test('standalone services use extended boot timeouts for cold starts', () => {
assert.match(bootTimeouts, /STANDALONE_BOOT_TIMEOUT_MS = 90_000/);
assert.match(bootTimeouts, /SERP_BOOT_TIMEOUT_MS = 90_000/);
assert.match(crawlHost, /dependencyReady\(STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(crawlHost, /override dependencyReady\(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(searcherHost, /dependencyReady\(STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(searcherHost, /override dependencyReady\(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(serpHost, /dependencyReady\(STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(serpHost, /override dependencyReady\(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(crawlServer, /dependencyReady\(STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(crawlServer, /override dependencyReady\(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(searchServer, /dependencyReady\(STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(searchServer, /override dependencyReady\(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(serpServer, /dependencyReady\(STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(serpServer, /override dependencyReady\(timeoutMilliseconds = STANDALONE_BOOT_TIMEOUT_MS\)/);
assert.match(googleSerp, /dependencyReady\(SERP_BOOT_TIMEOUT_MS\)/);
assert.match(googleSerp, /override dependencyReady\(timeoutMilliseconds = SERP_BOOT_TIMEOUT_MS\)/);
});