Staple the magic-nix-cache daemon log in error conditions

This commit is contained in:
Graham Christensen 2024-05-06 11:35:14 -04:00
parent 4ae13c51d8
commit 3b0ad43946
3 changed files with 16 additions and 4 deletions

10
dist/index.js generated vendored
View file

@ -94765,6 +94765,10 @@ var MagicNixCacheAction = class {
this.unsafeDaemonDir = this.idslib.getTemporaryName();
core.exportVariable(ENV_CACHE_DAEMONDIR, this.unsafeDaemonDir);
}
this.idslib.stapleFile(
"daemon.log",
external_node_path_namespaceObject.join(this.unsafeDaemonDir, "daemon.log")
);
}
async getDaemonDir() {
if (this.daemonDir === void 0) {
@ -94911,6 +94915,10 @@ var MagicNixCacheAction = class {
return `${lastPath}/bin/magic-nix-cache`;
}
async notifyAutoCache() {
if (!await this.daemonDirExists()) {
core.debug("magic-nix-cache not started - Skipping");
return;
}
try {
core.debug(`Indicating workflow start`);
const hostAndPort = inputs_exports.getString("listen");
@ -94923,7 +94931,7 @@ var MagicNixCacheAction = class {
}
}
async tearDownAutoCache() {
if (await this.daemonDirExists()) {
if (!await this.daemonDirExists()) {
core.debug("magic-nix-cache not started - Skipping");
return;
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -50,6 +50,10 @@ class MagicNixCacheAction {
this.unsafeDaemonDir = this.idslib.getTemporaryName();
actionsCore.exportVariable(ENV_CACHE_DAEMONDIR, this.unsafeDaemonDir);
}
this.idslib.stapleFile(
"daemon.log",
path.join(this.unsafeDaemonDir, "daemon.log"),
);
}
async getDaemonDir(): Promise<string> {
@ -235,7 +239,7 @@ class MagicNixCacheAction {
}
async notifyAutoCache(): Promise<void> {
if (!await this.daemonDirExists()) {
if (!(await this.daemonDirExists())) {
actionsCore.debug("magic-nix-cache not started - Skipping");
return;
}
@ -255,7 +259,7 @@ class MagicNixCacheAction {
}
async tearDownAutoCache(): Promise<void> {
if (!await this.daemonDirExists()) {
if (!(await this.daemonDirExists())) {
actionsCore.debug("magic-nix-cache not started - Skipping");
return;
}