From 5af1c1cdfb2d718004b02e9c0325ea6e758e78f1 Mon Sep 17 00:00:00 2001 From: Craig Date: Mon, 13 Mar 2017 13:36:20 -0700 Subject: [PATCH] fix(cache): change timestamp to 1 hour instead of 10 hours (#223) closes #221 --- lib/binaries/config_source.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/binaries/config_source.ts b/lib/binaries/config_source.ts index 1cf9f408..8532d392 100644 --- a/lib/binaries/config_source.ts +++ b/lib/binaries/config_source.ts @@ -53,7 +53,8 @@ export abstract class XmlConfigSource extends ConfigSource { let timestamp = new Date(fs.statSync(fileName).mtime).getTime(); let now = Date.now(); - if (now - 36000000 < timestamp) { + // 60 minutes * 60 seconds / minute * 1000 ms / second + if (now - (60 * 60 * 1000) < timestamp) { return this.convertXml2js(contents); } } catch (err) { @@ -172,7 +173,8 @@ export abstract class GithubApiConfigSource extends JsonConfigSource { let timestamp = new Date(fs.statSync(fileName).mtime).getTime(); let now = Date.now(); - if (now - 36000000 < timestamp) { + // 60 minutes * 60 seconds / minute * 1000 ms / second + if (now - (60 * 60 * 1000) < timestamp) { return contents; } } catch (err) {