Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ptlthg committed Sep 25, 2024
1 parent fc6e3ba commit 095b690
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/cachetimes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import credentials from './credentials.js';
import credentials from "./credentials.js";

/**
* Check if a resource is expired based on the cache time
Expand Down Expand Up @@ -44,4 +44,4 @@ export function isGuildCacheExpired(unixMs) {
*/
export function isBingoProfileCacheExpired(unixMs) {
return isCacheExpired(unixMs, credentials.cache.bingoProfiles);
}
}
4 changes: 2 additions & 2 deletions src/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const defaultCredentials = {
profiles: 60 * 5, // 5 minutes
bingoProfile: 60 * 5, // 5 minutes
museum: 60 * 30, // 30 minutes
guild: 60 * 60 * 24 // 24 hours
}
guild: 60 * 60 * 24, // 24 hours
},
};

/**
Expand Down
8 changes: 2 additions & 6 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,7 @@ export async function getProfile(

const lastCachedSave = profileObject.last_update;

if (
!options.cacheOnly && (cacheTimes.isProfileCacheExpired(lastCachedSave) || lastCachedSave === 0)
) {
if (!options.cacheOnly && (cacheTimes.isProfileCacheExpired(lastCachedSave) || lastCachedSave === 0)) {
try {
profileObject.last_update = Date.now();
response = await retry(
Expand Down Expand Up @@ -501,9 +499,7 @@ export async function getBingoProfile(
};

const lastCachedSave = profileData.last_save ?? 0;
if (
!options.cacheOnly && (cacheTimes.isBingoProfileCacheExpired(lastCachedSave) || lastCachedSave === 0)
) {
if (!options.cacheOnly && (cacheTimes.isBingoProfileCacheExpired(lastCachedSave) || lastCachedSave === 0)) {
try {
const response = await retry(
async () => {
Expand Down

0 comments on commit 095b690

Please sign in to comment.