fix(server): queue version check job when config changed (#27094)

Nothing happens when the version checks are enabled, which means the
server may return very stale versions until the next job runs.

Refs: #26935
This commit is contained in:
Thomas
2026-03-20 15:07:40 +00:00
committed by GitHub
parent 9a0c17fdb8
commit f3e4bcc733
2 changed files with 34 additions and 0 deletions
+7
View File
@@ -55,6 +55,13 @@ export class VersionService extends BaseService {
return this.versionRepository.getAll();
}
@OnEvent({ name: 'ConfigUpdate' })
async onConfigUpdate({ oldConfig, newConfig }: ArgOf<'ConfigUpdate'>) {
if (!oldConfig.newVersionCheck.enabled && newConfig.newVersionCheck.enabled) {
await this.handleQueueVersionCheck();
}
}
async handleQueueVersionCheck() {
await this.jobRepository.queue({ name: JobName.VersionCheck, data: {} });
}