INNER CODE UNIT · TypeScript

cleanExpiredClipCollections

raj457036/CopyCat-Clipboard · supabase/functions/clean_expired_clips/index.ts:7

async function cleanExpiredClipCollections(client: SupabaseClient) {
  const currentDate = new Date();

  // Subtract 30 days from the current date
  currentDate.setDate(currentDate.getDate() - 30);

  await client.from("clip_collections").delete().lt("deletedAt", currentDate);
}

async function cleanExpiredMediaClips(client: SupabaseClient) {
  // current account query offset
  let aqOffset = 0;
  while (true) {
    const accounts = await client.rpc(
      "get_user_clipboard_sync_duration",
      {
        grace_period: 3,
        free_hr: 24,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…