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
This commit is contained in:
Daniel Lockyer 2021-01-12 16:40:16 +00:00
parent 34411cfcc1
commit f6d5480c4f
17 changed files with 20 additions and 20 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/adapter-manager",
"version": "0.2.6",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/adapter-manager",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/adapter-manager",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/bootstrap-socket",
"version": "0.2.4",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/bootstrap-socket",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/bootstrap-socket",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/constants",
"version": "0.1.3",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/constants",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/constants",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/errors",
"version": "0.2.6",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/errors",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/errors",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/image-transform",
"version": "1.0.6",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/image-transform",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/image-transform",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -62,7 +62,7 @@ jobManager.addJob({
});
```
For more examples of JobManager initialization check [test/examples](https://github.com/TryGhost/Ghost-Utils/tree/master/packages/job-manager/test/examples) directory.
For more examples of JobManager initialization check [test/examples](https://github.com/TryGhost/Utils/tree/master/packages/job-manager/test/examples) directory.
### Job types and definitions
@ -74,7 +74,7 @@ Job manager's instance registers jobs through `addJob` method. The `offloaded` p
When `offloaded: false` parameter is passed into `addJob` method, job manager registers an **inline** function for execution in FIFO queue. The job should not be computationally intensive and should have small amount of asynchronous operations. The developer should always account that the function will be executed on the **same event loop, thread and process as caller's process**. **inline** jobs should be [JavaScript functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) or a path to a module that exports a function as default. Note, at the moment it's not possible to defined scheduled or recurring **inline** job.
When skipped or `offloaded: true` parameter is passed into `addJob` method, job manager registers execution of an **offloaded** job. The job can be scheduled to run immediately, in the future, or in recurring manner (through `at` parameter). Jobs created this way are managed by [bree](https://github.com/breejs/bree) job scheduling library. For examples of job scripts check out [this section](https://github.com/breejs/bree#nodejs-email-queue-job-scheduling-example) of bree's documentation, test [job examples](https://github.com/TryGhost/Ghost-Utils/tree/master/packages/job-manager/test/jobs).
When skipped or `offloaded: true` parameter is passed into `addJob` method, job manager registers execution of an **offloaded** job. The job can be scheduled to run immediately, in the future, or in recurring manner (through `at` parameter). Jobs created this way are managed by [bree](https://github.com/breejs/bree) job scheduling library. For examples of job scripts check out [this section](https://github.com/breejs/bree#nodejs-email-queue-job-scheduling-example) of bree's documentation, test [job examples](https://github.com/TryGhost/Utils/tree/master/packages/job-manager/test/jobs).
### Offloaded jobs rules of thumb
@ -88,8 +88,8 @@ To prevent complications around failed job retries and and handling of specific
Offloaded jobs are running on dedicated worker threads which makes their lifecycle a bit different to inline jobs:
1. When **starting** a job it's only sharing ENV variables with it's parent process. The job itself is run on an independent JavaScript execution thread. The script has to re-initialize any modules it will use. For example it should take care of: model layer initialization, cache initialization, etc.
2. When **finishing** work in a job prefer to signal successful termination by sending 'done' message to the parent thread: `parentPort.postMessage('done')` ([example use](https://github.com/TryGhost/Ghost-Utils/blob/0e423f6c5c69b08d81d470f49de95654d8cc90e3/packages/job-manager/test/jobs/graceful.js#L33-L37)). Finishing work this way terminates the thread through [worker.terminate()]((https://nodejs.org/dist/latest-v14.x/docs/api/worker_threads.html#worker_threads_worker_terminate)), which logs termination in parent process and flushes any pipes opened in thread.
3. Jobs that have iterative nature, or need cleanup before interrupting work should allow for **graceful shutdown** by listening on `'cancel'` message coming from parent thread ([example use](https://github.com/TryGhost/Ghost-Utils/blob/0e423f6c5c69b08d81d470f49de95654d8cc90e3/packages/job-manager/test/jobs/graceful.js#L12-L16)).
2. When **finishing** work in a job prefer to signal successful termination by sending 'done' message to the parent thread: `parentPort.postMessage('done')` ([example use](https://github.com/TryGhost/Utils/blob/0e423f6c5c69b08d81d470f49de95654d8cc90e3/packages/job-manager/test/jobs/graceful.js#L33-L37)). Finishing work this way terminates the thread through [worker.terminate()]((https://nodejs.org/dist/latest-v14.x/docs/api/worker_threads.html#worker_threads_worker_terminate)), which logs termination in parent process and flushes any pipes opened in thread.
3. Jobs that have iterative nature, or need cleanup before interrupting work should allow for **graceful shutdown** by listening on `'cancel'` message coming from parent thread ([example use](https://github.com/TryGhost/Utils/blob/0e423f6c5c69b08d81d470f49de95654d8cc90e3/packages/job-manager/test/jobs/graceful.js#L12-L16)).
4. When **exceptions** happen and expected outcome is to terminate current job, leave the exception unhandled allowing it to bubble up to the job manager. Unhandled exceptions [terminate current thread](https://nodejs.org/dist/latest-v14.x/docs/api/worker_threads.html#worker_threads_event_error) and allow for next scheduled job execution to happen.
For more nuances on job structure best practices check [bree documentation](https://github.com/breejs/bree#writing-jobs-with-promises-and-async-await).

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/job-manager",
"version": "0.7.0",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/job-manager",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/job-manager",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/moleculer-service-from-class",
"version": "0.2.9",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/moleculer-service-from-class",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/moleculer-service-from-class",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/mw-session-from-token",
"version": "0.1.13",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/mw-session-from-token",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/mw-session-from-token",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -2,7 +2,7 @@
"name": "@tryghost/pretty-cli",
"version": "1.2.12",
"description": "A mini-module to style a sywac instance in a standard way",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/pretty-cli",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/pretty-cli",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/promise",
"version": "0.1.3",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/promise",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/promise",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/release-utils",
"version": "0.6.9",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/release-utils",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/release-utils",
"author": "Ghost Foundation",
"license": "MIT",
"main": "lib/index.js",

View File

@ -15,7 +15,7 @@ describe('Changelog', function () {
changelog
.write({
githubRepoPath: `https://github.com/TryGhost/Ghost-Utils`,
githubRepoPath: `https://github.com/TryGhost/Utils`,
lastVersion: '@tryghost/release-utils@0.6.3'
})
.sort()

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/security",
"version": "0.2.3",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/security",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/security",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/session-service",
"version": "0.1.14",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/session-service",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/session-service",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/vhost-middleware",
"version": "1.0.10",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/vhost-middleware",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/vhost-middleware",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",

View File

@ -1,7 +1,7 @@
{
"name": "@tryghost/zip",
"version": "1.1.7",
"repository": "https://github.com/TryGhost/Ghost-Utils/tree/master/packages/zip",
"repository": "https://github.com/TryGhost/Utils/tree/master/packages/zip",
"author": "Ghost Foundation",
"license": "MIT",
"main": "index.js",