-
Start Postgres and create the database:
brew services start postgresql createdb delayed-job-test
-
Configure the database connection:
export DB=postgres:///delayed-job-test
-
Run migrations:
sequel -m db/migrations $DB
-
Start the job processing daemon:
./scripts/process-jobs run
-
Provide the mail body on
STDIN
and the email addresses as parameters:echo "Dear number $RANDOM, you are an awesome number! Best regards; The Computer." | ./scripts/enqueue-job foo@example.com bar@example.org
Here, we are sending a letter to foo@example.com and bar@example.org, each as a single job.
-
Verify that the mailer ran (we simulate it by appending to a 'queue' file):
tail -f log/mail.queue
Additional details about the job itself can be found in
log/delayed_job.log
.