Skip to content

Commit

Permalink
Merge pull request #59 from hanidamlaj/cache_time
Browse files Browse the repository at this point in the history
change cache time to env var
  • Loading branch information
hanidamlaj authored Sep 24, 2021
2 parents 48ba2f1 + 32d5acc commit 75d11e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/model/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { firestore } from "firebase-admin";
// Extract the environment variables that are needed.
const redis_url = process.env["REDIS_URL"];
const worker_url = process.env["worker_url"];
const cache_time = Number(process.env["CACHE_TIME"] ?? 30000);

// Connect to the Redis client.
const client = redis.createClient({
Expand Down Expand Up @@ -396,7 +397,7 @@ abstract class Database {
(
doc.data().updated as admin.firestore.Timestamp
).toMillis() >
300000;
cache_time;

return needsRenew
? null
Expand Down

0 comments on commit 75d11e5

Please sign in to comment.