Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix exat implementation

Steven Tey27e6b7ae0af9
diff --git a/app/api/cron/import/short/utils.ts b/app/api/cron/import/short/utils.ts
index e490bf5614..ba40d9e1f9 100644
--- a/app/api/cron/import/short/utils.ts
+++ b/app/api/cron/import/short/utils.ts
@@ -51,11 +51,20 @@ export const importLinksFromShort = async ({
if (path.length === 0) {
return null;
}
- pipeline.set(`${domain}:${path}`, {
- url: encodeURIComponent(originalURL),
- ...(iphoneURL && { ios: encodeURIComponent(iphoneURL) }),
- ...(androidURL && { android: encodeURIComponent(androidURL) }),
- });
+ const exat = expiresAt ? new Date(expiresAt).getTime() / 1000 : null;
+ pipeline.set(
+ `${domain}:${path}`,
+ {
+ url: encodeURIComponent(originalURL),
+ ...(iphoneURL && { ios: encodeURIComponent(iphoneURL) }),
+ ...(androidURL && { android: encodeURIComponent(androidURL) }),
+ },
+ {
+ nx: true,
+ // if the key has an expiry, set exat (type any cause there's a type error in the @types)
+ ...(exat && { exat: exat as any }),
+ },
+ );
return {
projectId,
domain,