Skip to content

Commit

Permalink
API Update Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
no1mann committed Dec 11, 2023
1 parent fe90044 commit f93a64a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions workers/tiltify-cache/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,14 @@ export class TiltifyData {

console.log('Alarm Called, fetching latest Tiltify data...');

//Get the current stored data
let data = await this.state.storage.get(DO_CACHE_KEY);

//Fetch the latest Tiltify data and cache it
let startTime = new Date();
let newData = await getLatestData(this.env);
let endTime = new Date();

let dataToStore = newData;

let isLive = newData.event.start <= Date.now() && newData.event.end >= Date.now();

console.log(`Finished Fetching, caching result Tiltify data... (${endTime - startTime}ms)`);

await this.state.storage.put(DO_CACHE_KEY, dataToStore);
await this.state.storage.put(DO_CACHE_KEY, newData);
}
}

Expand Down

0 comments on commit f93a64a

Please sign in to comment.