Commit Graph

18 Commits

Author SHA1 Message Date
Simon Backx
4c166e11df
Added E2E tests for batch sending (#15910)
refs https://github.com/TryGhost/Team/issues/2339

- Includes a new pattern in the job manager that allows us to properly
await jobs.
- Added new convenience mocking methods to stub settings
- Tests the main flows for bulk sending:
    - Sending in multiple batches
    - Sending to multiple segments
    - Handling a failed batch and retrying that batch
- Fixes bug in batch generation (ordering not working)

In a different PR I'll add more detailed tests.
2022-12-01 13:43:49 +01:00
Daniel Lockyer
c2e45b657f Removed bthreads dependency in favor of native worker_threads
fixes https://github.com/TryGhost/Toolbox/issues/370

- we no longer need `bthreads` because we can use native
  `worker_threads` now we don't have to support Node 10 any longer
- this allows us to clean up a dependency and stick with native
  libraries
- the referenced node-sqlite3 issue should be fixed (or at least, we now
  maintain it so we can fix it if not)
2022-08-09 09:04:59 +02:00
Naz
b0a2555465 Updated job manager documentation
no issue

- Minor cleanup of the outdated and ambiguous documentation. It wasn't loved in years, so got it's tiny facelift.
2022-08-01 16:47:45 +01:00
Naz
929946d744 Added documentation for one-off jobs
refs https://github.com/TryGhost/Toolbox/issues/359
refs 1606a10ff8

- One-off jobs have been released and needed a little bit of documentation for engineers to find their feet quick with a new concept.
- One-off jobs have a quality of executing only ever once within the lifetime of Ghost instance. For example this feature enabled moving members-migrations from the main path of boot process  - boosts the boot time significantly (refed commit)
2022-08-01 16:47:45 +01:00
Daniel Lockyer
0a5f600dfe
Tidied up package README and LICENSE files
- we shouldn't need individual LICENSE files because these packages
  won't be published, so the top-level one applies
- also cleaned up README files to remove mentions of Lerna monorepos and
  install instructions
2022-07-26 15:22:10 +02:00
John O'Nolan
279ce66e71 2022 2022-01-06 09:52:35 +00:00
John O'Nolan
61109d57a0 2021 2021-01-25 16:20:43 +00:00
Daniel Lockyer
f6d5480c4f Renamed TryGhost/Ghost-Utils links to TryGhost/Utils
no issue

- this repository has been renamed so this commit just brings all the
  links inline with this change
2021-01-12 16:40:16 +00:00
Naz
34411cfcc1 Improved documentation and job examples
refs  #122

- As job signature has changed in 3bca4f63b8 and documentation needed updates accordingly
2021-01-07 15:17:38 +13:00
Naz
13e8336de9 Updated docs around inline/offloaded jobs
no issue

- Provided more context about which type of job does what and introduced naming to be able to distinguish them
- The naming is still to be reviewed by peers
2020-12-09 20:04:09 +13:00
Naz
2462e9642e Added documentation for immediate jobs 2020-12-09 20:02:36 +13:00
Naz
73b60854cd Added documentation about bthread polyfill
refs https://github.com/TryGhost/Ghost/issues/12402
2020-11-25 15:21:02 +13:00
Naz
a2fdc69a23 Added docs about job lifecycle
refs https://github.com/orgs/TryGhost/projects/36#card-49938015
2020-11-25 15:03:54 +13:00
Naz
c3ab2be076 Added examples of job and job manager initialization 2020-11-25 13:44:04 +13:00
Naz
bc93a166e9 Updated readme with instructions about jobs
refs https://github.com/TryGhost/Ghost/issues/12402

- Describes different types of jobs that could be executed depending on the nature of the jobs.
- Lays down ground rules on how to design scheduled jobs
2020-11-24 20:15:02 +13:00
Naz
1340306f4c Updated job manager module description documentation 2020-11-24 19:55:51 +13:00
Naz
67e664208a Added documentation about job scheduling
refs https://github.com/TryGhost/Ghost/issues/12402

- Adds examples on how to queue regular "immediate" and reccuring "scheduled" jobs
2020-11-24 16:40:35 +13:00
Hannah Wolfe
2c1417da88 Added new job manager package
- Minimal working version of a job manager
- Uses fastq for handling the queue
- Exposes 2 methods: addJob and shutdown
2020-08-11 21:17:52 +01:00