mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
skip running the schedule service if the database is not loaded (#5810)
This commit is contained in:
@@ -5,6 +5,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { captureBreadcrumb } from '../../platform/exceptions';
|
||||
import * as connection from '../../platform/server/connection';
|
||||
import { logger } from '../../platform/server/log';
|
||||
import { currentDay, dayFromDate, parseDate } from '../../shared/months';
|
||||
import { q } from '../../shared/query';
|
||||
import {
|
||||
@@ -559,8 +560,12 @@ app.events.on('sync', ({ type }) => {
|
||||
type === 'success' || type === 'error' || type === 'unauthorized';
|
||||
|
||||
if (completeEvent && prefs.getPrefs()) {
|
||||
const { lastScheduleRun } = prefs.getPrefs();
|
||||
if (!db.getDatabase()) {
|
||||
logger.info('database is not available, skipping schedule service');
|
||||
return;
|
||||
}
|
||||
|
||||
const { lastScheduleRun } = prefs.getPrefs();
|
||||
if (lastScheduleRun !== currentDay()) {
|
||||
runMutator(() => advanceSchedulesService(type === 'success'));
|
||||
|
||||
|
||||
6
upcoming-release-notes/5810.md
Normal file
6
upcoming-release-notes/5810.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [matt-fidd]
|
||||
---
|
||||
|
||||
Skip the schedule service if the database is not loaded
|
||||
Reference in New Issue
Block a user