Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 2.1 KB

TODO.md

File metadata and controls

48 lines (38 loc) · 2.1 KB

TODO

Changes

  • make all trigger function names follow the format [before/after]-[insert/update]-[table_name]-tg-fn

  • make all trigger names follow the format [before/after]-[insert/update]-[table_name]-tg

  • extract all functions currently in tg functions into their own functions (for resusability)

    • e.g: process-jobs is good
  • update all trigger functions to be wrappers that use other named functions (for readability and resuability)

  • ensure there are unique constraints on the job and worker columns of the current_job table

  • test out using the 'skip locked' line in the process jobs functions

  • update the vault secret from supabase_serevice_role key to supaqueue_secret

    • in the vault
    • in the pg function that calls the edge function
    • in the edge funciton itself (must be added to env variables)
  • add an 'updated_at' column and tg to the jobs table, default now()s

    • sort the jobs in the process_jobs table on updated_at
    • add attempts filtering to the processing jobs fn.
  • support HTTP Methods (pass payload as body of req)

    • POST
    • GET (currently payload gets passed as query params, not body)
    • PATCH
    • DELETE
  • support explicit body and query params

    • should I make different paths? or use if/else in one function call?
  • UPDATE THE migration.sql file with changes

  • update the readme.md file with changes.

Testing

  • multiple concurrent queues
  • long running api calls
  • adding a job to the queue while queue is being processed
  • adding an API secret to the queue
  • calling a real edge function.

Feature Ideas

  • timebase rate limiting per queue
  • capturing the results of a job in the job table
  • capturing an array of errors from a job in the job table
  • add cron to 'kick' the queue every minute.
  • adding in crons to clean up jobs table every [day/week/month]
  • host the edge function in a node package, and make it importable to a custom edge function, scuh that users don't need to copy and paste code, just update version # for updated edge function.