Vapor and Job Queues: Getting Started | raywenderlich.com

Using Vapor’s Redis and Queues libraries, learn how to configure, dispatch, and process various jobs in a queue.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/18510630-vapor-and-job-queues-getting-started

Hi when executing the final project I get this error:
[ ERROR ] failed to create connection for pool [error: connection reset (error set): Connection refused (errno: 61), rdstk_conpool_id: C883BEBF-E4F4-4F57-9AF9-1922D103704A]

Any ideas what’s wrong? Is there any argument I need to be passing?

Hello,

I am getting the following error when building and running the final project with a scheduled job and a local Redis instance:

[ ERROR ] SendNewsletterJob failed: Abort.404: Not Found

I get this error every minute, but it’s not a very helpful error message. If I build and run via docker, I get a slew of these errors:

serve_1  | [ ERROR ] failed to create connection for pool [error: connection reset (error set): Connection refused (errno: 111), rdstk_conpool_id: 3F1539E7-00BB-4923-819E-39A7A74B7F1C] (RediStack/ConnectionPool/ConnectionPool.swift:249)
serve_1  | [ DEBUG ] reconnecting after failed connection attempt [rdstk_conn_retry_new_backoff: TimeAmount(nanoseconds: 25600000000)ns, rdstk_conn_retry_prev_backoff: TimeAmount(nanoseconds: 12800000000)ns, rdstk_conpool_id: 3F1539E7-00BB-4923-819E-39A7A74B7F1C] (RediStack/ConnectionPool/ConnectionPool.swift:283)

I made a modification to the final project to extend the connectionRetryTimeout, but that doesn’t help. Eventually my terminal prints out this block every minute, according to my schedule:

serve_1  | [ DEBUG ] Scheduling SendNewsletterJob to run at 2021-07-21 23:36:05 +0000 (Queues/ScheduledJob.swift:37)
serve_1  | [ DEBUG ] query read Newsletter filters=[Newsletter[sendAt] = 2021-07-21 00:00:00 +0000] limits=[count(1)] [database-id: sqlite] (FluentKit/Query/Builder/QueryBuilder.swift:283)
serve_1  | [ DEBUG ] No available connections on this event loop, creating a new one (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:202)
serve_1  | [ DEBUG ] Connected to sqlite db: db.sqlite (SQLiteNIO/SQLiteConnection.swift:112)
serve_1  | [ DEBUG ] PRAGMA foreign_keys = ON [] (SQLiteNIO/SQLiteConnection.swift:161)
serve_1  | [ DEBUG ] SELECT "Newsletter"."id" AS "Newsletter_id", "Newsletter"."title" AS "Newsletter_title", "Newsletter"."body" AS "Newsletter_body", "Newsletter"."sendAt" AS "Newsletter_sendAt", "Newsletter"."createdAt" AS "Newsletter_createdAt", "Newsletter"."updatedAt" AS "Newsletter_updatedAt" FROM "Newsletter" WHERE "Newsletter"."sendAt" = ? LIMIT 1 [1626825600.0] [database-id: sqlite] (SQLiteNIO/SQLiteConnection.swift:161)
serve_1  | [ DEBUG ] query read NewsletterRecipient [database-id: sqlite] (FluentKit/Query/Builder/QueryBuilder.swift:283)
serve_1  | [ DEBUG ] SELECT "NewsletterRecipient"."id" AS "NewsletterRecipient_id", "NewsletterRecipient"."email" AS "NewsletterRecipient_email", "NewsletterRecipient"."name" AS "NewsletterRecipient_name", "NewsletterRecipient"."createdAt" AS "NewsletterRecipient_createdAt" FROM "NewsletterRecipient" [] [database-id: sqlite] (SQLiteNIO/SQLiteConnection.swift:161)

I can’t tell if this means it’s ultimately working, but it seems like not. Also I’d prefer there to be no errors of course, if that’s the case.

Can you help?