Menu

1 / 4

Retry all: emailing invoices to a former employee

DEV Community: ruby·wyodeb·about 11 hours ago
#8LcAoPH3
#devtoruby#devto#dev#queue#database
Long article (2470 words) — no AI summary yet.
Reading 0:00
15s threshold

I moved our background jobs from Redis to Solid Queue, partly so there would be one less service to secure. That worked. The queue is now exactly as secure as our database, which is the system every SQL injection tutorial is about.

Here's the line I write in every app:

def export authorize @account , :export? ExportInvoicesJob . perform_later ( @account . id , current_user . id ) end

Enter fullscreen mode

Exit fullscreen mode

The policy passes and the job is enqueued. What follows is everything wrong with that line, in the order I found out.

1. Your queue is a table, and anyone who can write to it runs code

Solid Queue stores each job as a row in solid_queue_jobs .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.