Skip to content

Commit

Permalink
chore: reduce strict caching
Browse files Browse the repository at this point in the history
Signed-off-by: Okiki <hey@okikio.dev>
  • Loading branch information
okikio committed Oct 26, 2024
1 parent 87299e5 commit ee090b7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/edge/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,11 @@ export default {
const JSONResult = JSONResultString ? JSON5.parse<BundleResult>(JSONResultString) : null;

const [moduleName] = modules[0];
const PackageResultString = await redis.get<string>(getPackageResultKey(moduleName));
const PackageResultKey = getPackageResultKey(moduleName) + "/" + jsonKey;
const PackageResultString = await redis.get<string>(PackageResultKey);
const PackageResult = PackageResultString ? JSON5.parse<BundleResult>(PackageResultString) : null;

await redis.del(jsonKey, badgeKey, getPackageResultKey(moduleName));
await redis.del(jsonKey, badgeKey, PackageResultKey);
console.log(`Deleting "${getPackageResultKey(moduleName)}" and ${jsonKey}\n`)

if (JSONResult && JSONResult.fileId) {
Expand Down Expand Up @@ -427,7 +428,8 @@ export default {
if (modules.length === 1 && exportAll && !(shareQuery || textQuery)) {
const [moduleName, mode] = modules[0];
if (mode === "export") {
await redis.set(getPackageResultKey(moduleName), JSON5.stringify(value));
const PackageResultKey = getPackageResultKey(moduleName) + "/" + jsonKey;
await redis.set(PackageResultKey, JSON5.stringify(value));
}
}

Expand Down

0 comments on commit ee090b7

Please sign in to comment.