Skip to content

Commit

Permalink
fix(server): regular version check (#7620)
Browse files Browse the repository at this point in the history
`dt.diffNow()` equals `dt.diff(DateTime.now())`, so it returns a
negative number when `dt` is in the past (which it always is in this
case).

Therefore we could only get over the condition during startup (when
`this.releaseVersionCheckedAt` isn't set yet), effectively breaking
update notifications while the server is running.
  • Loading branch information
rovo89 committed Mar 4, 2024
1 parent 7ef202c commit de71d8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/domain/server-info/server-info.service.ts
Expand Up @@ -149,7 +149,7 @@ export class ServerInfoService {
}

// check once per hour (max)
if (this.releaseVersionCheckedAt && this.releaseVersionCheckedAt.diffNow().as('minutes') < 60) {
if (this.releaseVersionCheckedAt && DateTime.now().diff(this.releaseVersionCheckedAt).as('minutes') < 60) {
return true;
}

Expand Down

0 comments on commit de71d8e

Please sign in to comment.