mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
refactor(server): config system (#11081)
This commit is contained in:
@@ -25,9 +25,7 @@ export class CopilotStorage {
|
||||
private readonly storageFactory: StorageProviderFactory,
|
||||
private readonly quota: QuotaService
|
||||
) {
|
||||
this.provider = this.storageFactory.create(
|
||||
this.config.plugins.copilot.storage
|
||||
);
|
||||
this.provider = this.storageFactory.create(this.config.copilot.storage);
|
||||
}
|
||||
|
||||
@CallMetric('ai', 'blob_put')
|
||||
@@ -39,7 +37,7 @@ export class CopilotStorage {
|
||||
) {
|
||||
const name = `${userId}/${workspaceId}/${key}`;
|
||||
await this.provider.put(name, blob);
|
||||
if (this.config.node.dev || this.config.node.test) {
|
||||
if (!env.prod) {
|
||||
// return image base64url for dev environment
|
||||
return `data:image/png;base64,${blob.toString('base64')}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user