-
Notifications
You must be signed in to change notification settings - Fork 123
Services: Track when services are not needed #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9142be5
23932d7
92b91f8
649ff19
4d000e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ export class Executor { | |
| private readonly _logger: Logger; | ||
| private readonly _workerPool: WorkerPool; | ||
| private readonly _cache?: Cache; | ||
| private readonly _abort: Deferred<void>; | ||
|
|
||
| /** Resolves when the first failure occurs in any script. */ | ||
| private readonly _failureOccured = new Deferred<void>(); | ||
|
|
@@ -69,6 +70,7 @@ export class Executor { | |
| this._logger = logger; | ||
| this._workerPool = workerPool; | ||
| this._cache = cache; | ||
| this._abort = abort; | ||
|
|
||
| // If this entire execution is aborted because e.g. the user sent a SIGINT | ||
| // to the Wireit process, then dont start new scripts, and kill running | ||
|
|
@@ -140,7 +142,12 @@ export class Executor { | |
| if (config.command === undefined) { | ||
| execution = new NoCommandScriptExecution(config, this, this._logger); | ||
| } else if (config.service) { | ||
| execution = new ServiceScriptExecution(config, this, this._logger); | ||
| execution = new ServiceScriptExecution( | ||
| config, | ||
| this, | ||
| this._logger, | ||
| this._abort.promise | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why aren't you using an AbortSignal?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it's only supported in Node 15+, and we still support Node 14 until it goes out of LTS next year. Simpler than having a polyfill since it's so trivial anyway. |
||
| ); | ||
| } else { | ||
| execution = new StandardScriptExecution( | ||
| config, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this is not a very well formatted diff. It's all indentation inside the
try.