mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +00:00
fix: only cache config on cf workers
This commit is contained in:
parent
b0e10fd4a9
commit
285ec140a0
@ -100,7 +100,7 @@ export class BaseClient {
|
||||
options: BaseClientOptions;
|
||||
|
||||
/**@internal */
|
||||
static _seyfertConfig?: InternalRuntimeConfigHTTP | InternalRuntimeConfig;
|
||||
static _seyfertCfWorkerConfig?: InternalRuntimeConfigHTTP | InternalRuntimeConfig;
|
||||
|
||||
constructor(options?: BaseClientOptions) {
|
||||
this.options = MergeOptions(
|
||||
@ -384,7 +384,7 @@ export class BaseClient {
|
||||
async getRC<
|
||||
T extends InternalRuntimeConfigHTTP | InternalRuntimeConfig = InternalRuntimeConfigHTTP | InternalRuntimeConfig,
|
||||
>() {
|
||||
const seyfertConfig = (BaseClient._seyfertConfig ||
|
||||
const seyfertConfig = (BaseClient._seyfertCfWorkerConfig ||
|
||||
(await this.options?.getRC?.()) ||
|
||||
(await Promise.any(
|
||||
['.js', '.mjs', '.cjs', '.ts', '.mts', '.cts'].map(ext =>
|
||||
@ -407,8 +407,6 @@ export class BaseClient {
|
||||
output: join(process.cwd(), locations.output),
|
||||
};
|
||||
|
||||
BaseClient._seyfertConfig = seyfertConfig;
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ export const config = {
|
||||
port: 8080,
|
||||
...data,
|
||||
} as InternalRuntimeConfigHTTP;
|
||||
if (isCloudfareWorker()) BaseClient._seyfertConfig = obj;
|
||||
if (isCloudfareWorker()) BaseClient._seyfertCfWorkerConfig = obj;
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user