diff options
author | mat <github@matdoes.dev> | 2021-10-03 12:08:41 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2021-10-03 12:08:41 -0500 |
commit | 7afe165979419f1fd96f6356f32ded35cb143de9 (patch) | |
tree | 9fd58fb5721804c1f470e7ae0ac13e7eb37b3d27 /src/constants.ts | |
parent | 1291f0f32b6f626666b6fb86b8d87e3c4293cb7c (diff) | |
download | skyblock-api-7afe165979419f1fd96f6356f32ded35cb143de9.tar.gz skyblock-api-7afe165979419f1fd96f6356f32ded35cb143de9.tar.bz2 skyblock-api-7afe165979419f1fd96f6356f32ded35cb143de9.zip |
attempt to fix memory leak
Diffstat (limited to 'src/constants.ts')
-rw-r--r-- | src/constants.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/constants.ts b/src/constants.ts index 13fc21d..3cc77d2 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -76,7 +76,7 @@ const fileCache = new NodeCache({ */ function fetchFile(path: string): Promise<GithubFile> { return new Promise(resolve => { - queue.enqueue(async() => { + queue.enqueue(async () => { if (fileCache.has(path)) return resolve(fileCache.get(path)!) @@ -137,7 +137,7 @@ export let fetchJSONConstant = async function fetchJSONConstant(filename: string } /** Add stats to skyblock-constants. This has caching so it's fine to call many times */ -export let addJSONConstants = async function addJSONConstants(filename: string, addingValues: string[], unit: string='stat'): Promise<void> { +export let addJSONConstants = async function addJSONConstants(filename: string, addingValues: string[], unit: string = 'stat'): Promise<void> { if (addingValues.length === 0) return // no stats provided, just return let file: GithubFile = await fetchFile(filename) @@ -268,7 +268,7 @@ export async function setConstantValues(newValues: constantValues) { const commitMessage = 'Update values' try { await editFile(file, commitMessage, JSON.stringify(updatedStats, null, 2)) - } catch {} + } catch { } } |