Skip to content

Commit

Permalink
Merge pull request #27 from frc-862/26-sheets
Browse files Browse the repository at this point in the history
26 sheets
  • Loading branch information
Mikecerc authored Mar 30, 2023
2 parents 5047c9e + 958421f commit 0456268
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 175 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-battery-logger",
"version": "2.2.1",
"version": "2.3.1",
"description": "A digital battery logger for FRC",
"main": "./dist/main/index.js",
"type": "commonjs",
Expand Down
13 changes: 9 additions & 4 deletions src/main/api/periodicSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ const url = "https://www.google.com";
import { config } from "../store";
const minutes = config.store.api.syncTimeMinutes;
export const startSync = () => {
cron.schedule(`*/${minutes % 60} */${minutes % 60} * * *`, () => {
if (!checkInternet()) return;
sync().catch();
});
cron.schedule(
`*/${minutes % 60} *${
Math.floor(minutes / 60) != 0 ? "/" + Math.floor(minutes / 60) : ""
} * * *`,
() => {
if (!checkInternet()) return;
sync().catch();
},
);
};

const checkInternet = async () => {
Expand Down
Loading

0 comments on commit 0456268

Please sign in to comment.