mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
refactor(server): use feature model (#9932)
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
StorageProviderFactory,
|
||||
URLHelper,
|
||||
} from '../../base';
|
||||
import { QuotaManagementService } from '../../core/quota';
|
||||
import { QuotaService } from '../../core/quota';
|
||||
|
||||
@Injectable()
|
||||
export class CopilotStorage {
|
||||
@@ -22,7 +22,7 @@ export class CopilotStorage {
|
||||
private readonly config: Config,
|
||||
private readonly url: URLHelper,
|
||||
private readonly storageFactory: StorageProviderFactory,
|
||||
private readonly quota: QuotaManagementService
|
||||
private readonly quota: QuotaService
|
||||
) {
|
||||
this.provider = this.storageFactory.create(
|
||||
this.config.plugins.copilot.storage
|
||||
@@ -57,7 +57,7 @@ export class CopilotStorage {
|
||||
|
||||
@CallMetric('ai', 'blob_upload')
|
||||
async handleUpload(userId: string, blob: FileUpload) {
|
||||
const checkExceeded = await this.quota.getQuotaCalculator(userId);
|
||||
const checkExceeded = await this.quota.getUserQuotaCalculator(userId);
|
||||
|
||||
if (checkExceeded(0)) {
|
||||
throw new BlobQuotaExceeded();
|
||||
|
||||
Reference in New Issue
Block a user