Skip to content

Commit

Permalink
refractor: decrease cron interval duration (#24)
Browse files Browse the repository at this point in the history
* refractor: decrease cron interval duration

* refractor: decrease cache duration
  • Loading branch information
fabio-nettis authored Mar 28, 2024
1 parent 87c1b53 commit 548d8a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jobs/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Cache from "memory-cache";
import { refreshAndStoreSourceData } from "utils/refresh";

new CronJob(
"0 */30 * * * *",
"0 */1 * * * *",
async () => {
const startDate = Date.now();
console.log("Refreshing source data");
Expand Down
2 changes: 1 addition & 1 deletion src/utils/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function witCache(cb: RouteController) {
Cache.put(
key,
JSON.stringify({ status: response.status, data }),
30 * 60 * 1000,
(1 * 50 * 1000) / 1.5,
);

ctx.status(response.status as any);
Expand Down

0 comments on commit 548d8a7

Please sign in to comment.