mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-08-26 18:47:47 -05:00
Removed trello and implemented in-memory cache
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
const Trello =require('trello');
|
||||
const Redis = require('ioredis');
|
||||
const JSONCache = require('redis-json');
|
||||
const got = require('got');
|
||||
const config = require('../config.json');
|
||||
|
||||
const trello = new Trello(config.trello.api_key, config.trello.api_token);
|
||||
const redis = new Redis();
|
||||
const trelloCache = new JSONCache(redis, { prefix: 'trello:' });
|
||||
let cache;
|
||||
|
||||
async function getTrelloCache() {
|
||||
let cache = await trelloCache.get('latest');
|
||||
if (!cache) {
|
||||
cache = await updateTrelloCache();
|
||||
}
|
||||
@@ -64,8 +60,6 @@ async function updateTrelloCache() {
|
||||
}
|
||||
}
|
||||
|
||||
await trelloCache.clearAll();
|
||||
await trelloCache.set('latest', progressData);
|
||||
return progressData;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user