Skip to content

Commit

Permalink
avniproject/avni-product#1670 merging after release of 10.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vedfordev committed Dec 4, 2024
2 parents d79da45 + caaf2e4 commit 7432413
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions packages/openchs-android/src/AvniBackgroundJob.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import DeleteDrafts from "./task/DeleteDrafts";
import DummySync from "./task/DummySync";
import PruneMedia from "./task/PruneMedia";
import Sync from "./task/Sync";
import WorkManager from 'react-native-background-worker';
import General from "./utility/General";
Expand Down Expand Up @@ -35,24 +34,12 @@ const DeleteDraftsJobSchedule = {
job: async() => await DeleteDrafts.execute()
};

const PruneMediaJobSchedule = {
jobKey: "pruneMediaJob",
timeout: 10,
period: 1 * 24 * 60,
persist: true,
exact: true,
job: async() => await PruneMedia.execute()
};

//The jobs with identifier job keys are persisted. This is required for background jobs to persist over device restarts. If you are changing the job key then remember to cancel the job with the old job key.
export const RegisterAndScheduleJobs = function () {
General.logDebug("AvniBackgroundJob", `Background job is ${EnvironmentConfig.autoSyncDisabled ? "disabled" : "enabled"}`);
Schedule(DeleteDraftsJobSchedule)
.then(() => General.logInfo("AvniBackgroundJob-DeleteDraftsJob", "Successfully scheduled"))
.catch(err => General.logError("AvniBackgroundJob-DeleteDraftsJob", err));
Schedule(PruneMediaJobSchedule)
.then(() => General.logInfo("AvniBackgroundJob-PruneMediaJob", "Successfully scheduled"))
.catch(err => General.logError("AvniBackgroundJob-PruneMediaJob", err));
Schedule(SyncJobSchedule)
.then(() => General.logInfo("AvniBackgroundJob-SyncJob", "Successfully scheduled"))
.catch(err => General.logError("AvniBackgroundJob-SyncJob", err));
Expand Down

0 comments on commit 7432413

Please sign in to comment.