summaryrefslogtreecommitdiff
path: root/src/functions
diff options
context:
space:
mode:
Diffstat (limited to 'src/functions')
-rw-r--r--src/functions/scheduled.ts22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/functions/scheduled.ts b/src/functions/scheduled.ts
index 5aa3fa0..ae43469 100644
--- a/src/functions/scheduled.ts
+++ b/src/functions/scheduled.ts
@@ -8,9 +8,6 @@ interface Env {
IMGS_BUCKET: R2Bucket;
}
-interface ImageData {
- [key: string]: string[];
-}
class GeshemUpdate {
private bucket: R2Bucket;
@@ -118,29 +115,10 @@ class GeshemUpdate {
return `imgs/${d}/${t}/${res}.png`;
}
- private async generateJson(): Promise<void> {
- const latestKeys = await this.getLatestBucketKeys();
- const keys = latestKeys
- .filter(key => key.endsWith('280.png'))
- .sort()
- .slice(-10);
-
- const index: ImageData = { '280': keys };
-
- await this.bucket.put('imgs.json', JSON.stringify(index), {
- httpMetadata: {
- contentType: 'application/json',
- cacheControl: 'public, max-age=60'
- }
- });
- }
async run(): Promise<string> {
try {
const updated = await this.fetchMissingImages();
- if (updated) {
- await this.generateJson();
- }
return `Updated: ${updated}`;
} catch (error) {
console.error('Error in GeshemUpdate.run():', error);