Fix scheduler and OS X

This commit is contained in:
2021-02-23 13:49:26 -06:00
parent 2bebdeab1a
commit e77c321deb
2 changed files with 6 additions and 5 deletions

View File

@@ -16,7 +16,7 @@
"electron-log": "^4.3.0",
"focus-trap-react": "^8.3.2",
"font-awesome": "^4.7.0",
"node-schedule": "^1.3.2",
"node-cron": "^1.2.1",
"randomstring": "^1.1.5",
"react": "^16.14.0",
"react-checkbox-tree": "^1.6.0",
@@ -36,7 +36,8 @@
"electron": "5.0.13",
"electron-builder": "22.9.1",
"electron-webpack": "^2.8.2",
"webpack": "4.44.2"
"webpack": "4.44.2",
"webpack-dev-server": "3.11.1"
},
"scripts": {
"start": "react-scripts start",

View File

@@ -39,7 +39,7 @@ import SkynetExport from './containers/SkynetExport/SkynetExport';
import PinnedManager from './containers/PinnedManager/PinnedManager';
const Constants = require('./constants');
const Scheduler = require('node-schedule');
const Scheduler = require('node-cron');
class App extends IPCContainer {
componentDidMount() {
@@ -55,7 +55,7 @@ class App extends IPCContainer {
}
};
detectUpgrades();
this.scheduledUpdateJob = Scheduler.scheduleJob('23 11 * * *', detectUpgrades);
this.scheduledUpdateJob = Scheduler.schedule('23 11 * * *', detectUpgrades);
}
componentDidUpdate(prevProps) {
@@ -71,7 +71,7 @@ class App extends IPCContainer {
}
componentWillUnmount() {
Scheduler.cancelJob(this.scheduledUpdateJob);
this.scheduledUpdateJob.stop();
super.componentWillUnmount();
}