fix: CACHE IT DAMN IT

This commit is contained in:
Saahil 2025-03-27 11:27:31 -04:00
parent ff48b40256
commit 808aa35065
No known key found for this signature in database
GPG key ID: 8A8B64515254CFC6

View file

@ -197,10 +197,12 @@ export async function cronForTrackingData(app: ModifiedApp) {
for (const { flightId, userId } of IdsToTrack) {
const flightD = await getFlightData(flightId);
const changes = await detectChanges(flightD, app.dbs.flightly.get(userId));
if(changes.length > 0){
await app.client.chat.postMessage({
channel: userId,
text: changes.join("\n"),
});
}
app.dbs.flightly.set(userId, flightD);
await new Promise((r) => setTimeout(r, 1000));
}