Skip to content

Commit

Permalink
fix(updater): disable checking on debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Feb 17, 2022
1 parent 139e5c6 commit 30d0f9b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/updater.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { exec, execSync } from 'child_process';

import { HOUR } from '@sogebot/ui-helpers/constants';
import { HOUR, MINUTE } from '@sogebot/ui-helpers/constants';
import { clone } from 'lodash';

import Core from '~/_interface';
Expand Down Expand Up @@ -31,16 +31,21 @@ class Updater extends Core {

@onStartup()
onStartup() {
// get current versions
for (const pkg of Object.keys(this.versions) as Array<keyof typeof versions> ) {
const actualVersion = execSync(`node -p "require('${pkg}/package.json').version"`).toString().replace('\n', '');
this.versions[pkg] = actualVersion;
if ((process.env.NODE_ENV || 'development') === 'development') {
return;
}
setTimeout(() => {
// get current versions
for (const pkg of Object.keys(this.versions) as Array<keyof typeof versions> ) {
const actualVersion = execSync(`node -p "require('${pkg}/package.json').version"`).toString().replace('\n', '');
this.versions[pkg] = actualVersion;
}

this.checkUpdate();
setInterval(() => {
this.checkUpdate();
}, HOUR);
setInterval(() => {
this.checkUpdate();
}, HOUR);
}, MINUTE * 10);
}

sockets() {
Expand Down

0 comments on commit 30d0f9b

Please sign in to comment.