timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.15k stars 160 forks source link

Added event after-purge #360

Closed ismael-iskauskas closed 1 year ago

ismael-iskauskas commented 1 year ago

A new event that gets triggered if purge on archive table deleted some records. I needed this because i use pg-boss in an multi-tenancy enviroment. pg-boss runs as microservice with access to multiple tenants. In the tenants are joblogs that mus be deleted if the job is deleted.

coveralls commented 1 year ago

Coverage Status

Coverage: 100.0%. Remained the same when pulling ff2517be69f9e4649d1350b469a8f72dabaf17f5 on ismael-iskauskas:emit-event-on-purge into 1bfaa8d0891594188e900ec2de183e51614ba1e9 on timgit:master.

ismael-iskauskas commented 1 year ago

Don't know why the test "should accept a custom clock monitoring interval in seconds" fails

schedule
      should send job based on every minute expression (schema: pgbosscd8b5528db)...
    ✔ should send job based on every minute expression (9635ms)
      should accept a custom clock monitoring interval in seconds (schema: pgboss74bc83e488)...
    ✔ should accept a custom clock monitoring interval in seconds (9368ms)
...
...
176 passing (9m)
  1 pending

-------------------|---------|----------|---------|---------|---------------------------------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|---------------------------------------------
All files          |   99.46 |    88.21 |   99.15 |   99.88 | 
 attorney.js       |     100 |    89.52 |     100 |     100 | 114,213-226,245-253,267-269,318-331,359-363
 boss.js           |     100 |    88.88 |     100 |     100 | 135,154,229-245
 contractor.js     |   97.05 |    53.33 |     100 |   97.05 | 55
 db.js             |   93.33 |    83.33 |      80 |     100 | 20
 index.js          |     100 |    87.23 |     100 |     100 | 81,120
 manager.js        |     100 |    92.36 |    98.5 |     100 | 182,228,271,299,364,465-467,530,566-587    
 migrationStore.js |     100 |       80 |     100 |     100 | 25-29
 plans.js          |     100 |      100 |     100 |     100 | 
 timekeeper.js     |   97.16 |    76.31 |     100 |     100 | 79-84,110,142-179,201-218
 worker.js         |     100 |     90.9 |     100 |     100 | 36
-------------------|---------|----------|---------|---------|---------------------------------------------