refactor(server): standalone runtime module (#9120)

This commit is contained in:
forehalo
2024-12-13 06:27:14 +00:00
parent 4c23991047
commit 81c68032e1
18 changed files with 85 additions and 75 deletions

View File

@@ -7,6 +7,7 @@ import {
Config,
mergeUpdatesInApplyWay as yotcoMergeUpdates,
metrics,
Runtime,
} from '../../base';
import { PermissionService } from '../permission';
import { QuotaService } from '../quota';
@@ -35,6 +36,7 @@ export class DocStorageOptions implements IDocStorageOptions {
constructor(
private readonly config: Config,
private readonly runtime: Runtime,
private readonly permission: PermissionService,
private readonly quota: QuotaService
) {}
@@ -43,9 +45,7 @@ export class DocStorageOptions implements IDocStorageOptions {
const doc = await this.recoverDoc(updates);
const yjsResult = Buffer.from(Y.encodeStateAsUpdate(doc));
const useYocto = await this.config.runtime.fetch(
'doc/experimentalMergeWithYOcto'
);
const useYocto = await this.runtime.fetch('doc/experimentalMergeWithYOcto');
if (useYocto) {
metrics.jwst.counter('codec_merge_counter').add(1);