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.

452 B
Raw Blame
import { recordLink } from "@/lib/tinybird/record-link";
import { linkCache } from "./cache";
import { ExpandedLink } from "./utils/transform-link";

export async function propagateBulkLinkChanges({
  links,
  skipRedisCache = false,
}: {
  links: ExpandedLink[];
  skipRedisCache?: boolean;
}) {
  return await Promise.all([
    // update Redis cache
    !skipRedisCache && linkCache.mset(links),
    // update Tinybird
    recordLink(links),
  ]);
}