fix cron job not starting

This commit is contained in:
lingdocs 2021-08-22 23:59:11 +04:00
parent 0cb2eddd20
commit 328177c9ff
1 changed files with 3 additions and 2 deletions

View File

@ -130,6 +130,7 @@ class App extends Component<RouteComponentProps, State> {
ReactGA.pageview(window.location.pathname + window.location.search); ReactGA.pageview(window.location.pathname + window.location.search);
} }
dictionary.initialize().then((r) => { dictionary.initialize().then((r) => {
this.networkCronJob.stop();
this.setState({ this.setState({
dictionaryStatus: "ready", dictionaryStatus: "ready",
dictionaryInfo: r.dictionaryInfo, dictionaryInfo: r.dictionaryInfo,
@ -334,8 +335,8 @@ class App extends Component<RouteComponentProps, State> {
} }
} }
private networkCronJob = new CronJob("1/5 * * * *", () => { private networkCronJob = new CronJob("* * * * *", () => {
// TODO: check for new dictionary (in a seperate cron job - not dependant on the user being signed in) // TODO: check for new dictionary (in a seperate cron job - not dependant on the user being signed in)\
this.handleLoadUser(); this.handleLoadUser();
sendSubmissions(); sendSubmissions();
this.handleDictionaryUpdate(); this.handleDictionaryUpdate();