feat: Use postgres as a queue

We've been keen to try this for a while as it means we can remove redis as a
dependency, which makes Immich easier to setup and run.

This replaces bullmq with a bespoke postgres queue. Jobs in the queue are
processed either immediately via triggers and notifications, or eventually if a
notification is missed.
This commit is contained in:
Thomas Way
2025-04-30 22:42:18 +01:00
parent b845184c80
commit d46e5f2436
47 changed files with 751 additions and 933 deletions

View File

@@ -32,7 +32,7 @@ export const asPostgresConnectionConfig = (params: DatabaseConnectionParams) =>
return {
host: params.host,
port: params.port,
username: params.username,
user: params.username,
password: params.password,
database: params.database,
ssl: undefined,
@@ -51,7 +51,7 @@ export const asPostgresConnectionConfig = (params: DatabaseConnectionParams) =>
return {
host: host ?? undefined,
port: port ? Number(port) : undefined,
username: user,
user,
password,
database: database ?? undefined,
ssl,
@@ -92,7 +92,7 @@ export const getKyselyConfig = (
},
host: config.host,
port: config.port,
username: config.username,
user: config.user,
password: config.password,
database: config.database,
ssl: config.ssl,