feat(server): enable share og information for docs (#7794)

This commit is contained in:
forehalo
2024-09-10 04:03:52 +00:00
parent 34eac4c24e
commit 0add8917f9
24 changed files with 449 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
import { Injectable, Logger, OnModuleInit } from '@nestjs/common';
import { Injectable, Logger, OnModuleInit, Optional } from '@nestjs/common';
import { Cron, CronExpression, SchedulerRegistry } from '@nestjs/schedule';
import { PrismaClient } from '@prisma/client';
@@ -11,14 +11,14 @@ export class DocStorageCronJob implements OnModuleInit {
private busy = false;
constructor(
private readonly registry: SchedulerRegistry,
private readonly config: Config,
private readonly db: PrismaClient,
private readonly workspace: PgWorkspaceDocStorageAdapter
private readonly workspace: PgWorkspaceDocStorageAdapter,
@Optional() private readonly registry?: SchedulerRegistry
) {}
onModuleInit() {
if (this.config.doc.manager.enableUpdateAutoMerging) {
if (this.registry && this.config.doc.manager.enableUpdateAutoMerging) {
this.registry.addInterval(
this.autoMergePendingDocUpdates.name,
// scheduler registry will clean up the interval when the app is stopped