Fix incorrect expiration ttl

This commit is contained in:
Joe Ma 2022-08-31 11:10:22 +08:00
parent f7273ceb79
commit b47b2ff609
No known key found for this signature in database
GPG key ID: 7A0ECF5F5EDC587F

View file

@ -224,7 +224,7 @@ export default {
}; };
// Key will be expired after 28 day if unmodified // Key will be expired after 28 day if unmodified
ctx.waitUntil(env.PASTE_INDEX.put(uuid, JSON.stringify(descriptor), {expirationTtl: 100800})); ctx.waitUntil(env.PASTE_INDEX.put(uuid, JSON.stringify(descriptor), {expirationTtl: 2419200}));
return new Response(get_paste_info(uuid, descriptor)); return new Response(get_paste_info(uuid, descriptor));
} else { } else {
return new Response('Unable to upload the paste.\n', { return new Response('Unable to upload the paste.\n', {
@ -319,7 +319,7 @@ export default {
}); });
} }
descriptor.read_count_remain--; descriptor.read_count_remain--;
ctx.waitUntil(env.PASTE_INDEX.put(uuid, JSON.stringify(descriptor), {expirationTtl: 100800})); ctx.waitUntil(env.PASTE_INDEX.put(uuid, JSON.stringify(descriptor), {expirationTtl: 2419200}));
} }
// Enable CF cache for authorized request // Enable CF cache for authorized request