mirror of
https://github.com/DeterminateSystems/magic-nix-cache-action.git
synced 2024-12-26 01:12:17 +01:00
Merge pull request #49 from DeterminateSystems/late-start
Don't mark the daemon started until after we successfully import the …
This commit is contained in:
commit
88b25d24b9
3 changed files with 6 additions and 5 deletions
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
|
@ -94819,8 +94819,6 @@ var MagicNixCacheAction = class {
|
|||
core.debug(
|
||||
`GitHub Action Cache URL: ${process.env["ACTIONS_CACHE_URL"]}`
|
||||
);
|
||||
this.daemonStarted = true;
|
||||
core.saveState(STATE_STARTED, STARTED_HINT);
|
||||
const sourceBinary = inputs_exports.getStringOrNull("source-binary");
|
||||
const daemonBin = sourceBinary !== null ? sourceBinary : await this.fetchAutoCacher();
|
||||
let runEnv;
|
||||
|
@ -94897,6 +94895,8 @@ var MagicNixCacheAction = class {
|
|||
core.debug("Full daemon start command:");
|
||||
core.debug(`${daemonBin} ${daemonCliFlags.join(" ")}`);
|
||||
const daemon = (0,external_node_child_process_namespaceObject.spawn)(daemonBin, daemonCliFlags, opts);
|
||||
this.daemonStarted = true;
|
||||
core.saveState(STATE_STARTED, STARTED_HINT);
|
||||
const pidFile = external_node_path_namespaceObject.join(this.daemonDir, "daemon.pid");
|
||||
await promises_namespaceObject.writeFile(pidFile, `${daemon.pid}`);
|
||||
core.info("Waiting for magic-nix-cache to start...");
|
||||
|
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
@ -109,8 +109,6 @@ class MagicNixCacheAction {
|
|||
`GitHub Action Cache URL: ${process.env["ACTIONS_CACHE_URL"]}`,
|
||||
);
|
||||
|
||||
this.daemonStarted = true;
|
||||
actionsCore.saveState(STATE_STARTED, STARTED_HINT);
|
||||
const sourceBinary = inputs.getStringOrNull("source-binary");
|
||||
const daemonBin =
|
||||
sourceBinary !== null ? sourceBinary : await this.fetchAutoCacher();
|
||||
|
@ -206,6 +204,9 @@ class MagicNixCacheAction {
|
|||
// Start the server. Once it is ready, it will notify us via the notification server.
|
||||
const daemon = spawn(daemonBin, daemonCliFlags, opts);
|
||||
|
||||
this.daemonStarted = true;
|
||||
actionsCore.saveState(STATE_STARTED, STARTED_HINT);
|
||||
|
||||
const pidFile = path.join(this.daemonDir, "daemon.pid");
|
||||
await fs.writeFile(pidFile, `${daemon.pid}`);
|
||||
|
||||
|
|
Loading…
Reference in a new issue