Skip to content

Provide setupFn for PgBoss options #2847

Open
@infomiho

Description

@infomiho

Motivated by this issue: #2846

Currently we ask users to pass JSON via env variables to set up PgBoss which is not the best DX. It's also fragile since the current implementation overrides the connection string:

function createPgBoss() {
  let pgBossNewOptions = {
    connectionString: config.databaseUrl,
  }

  if (env.PG_BOSS_NEW_OPTIONS) {
      pgBossNewOptions = JSON.parse(env.PG_BOSS_NEW_OPTIONS)
  }

  return new PgBoss(pgBossNewOptions)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions