mirror of
https://github.com/cachix/cachix-action.git
synced 2025-06-08 07:07:00 +09:00
Add a small delay to allow all the post-build hooks to flush
This commit is contained in:
parent
aa9851471c
commit
5581d69e7f
2 changed files with 14 additions and 2 deletions
7
dist/main/index.js
vendored
7
dist/main/index.js
vendored
|
@ -7920,13 +7920,15 @@ async function upload() {
|
|||
core.debug(`Found Cachix daemon with pid ${daemonPid}`);
|
||||
let daemonLog = new tail_1.Tail(`${daemonDir}/daemon.log`, { fromBeginning: true });
|
||||
daemonLog.on('line', (line) => core.info(line));
|
||||
// Give the Nix daemon time to send out the post-build hooks
|
||||
await sleep(300);
|
||||
try {
|
||||
core.debug('Waiting for Cachix daemon to exit...');
|
||||
await exec.exec(cachixBin, ["daemon", "stop", "--socket", `${daemonDir}/daemon.sock`]);
|
||||
}
|
||||
finally {
|
||||
// Wait a bit for the logs to flush through
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
await sleep(1000);
|
||||
daemonLog.unwatch();
|
||||
}
|
||||
break;
|
||||
|
@ -8089,6 +8091,9 @@ function partitionUsersAndGroups(mixedUsers) {
|
|||
function splitArgs(args) {
|
||||
return args.split(' ').filter((arg) => arg !== '');
|
||||
}
|
||||
async function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
const isPost = !!core.getState('isPost');
|
||||
// Main
|
||||
try {
|
||||
|
|
|
@ -234,12 +234,15 @@ async function upload() {
|
|||
let daemonLog = new Tail(`${daemonDir}/daemon.log`, { fromBeginning: true });
|
||||
daemonLog.on('line', (line) => core.info(line));
|
||||
|
||||
// Give the Nix daemon time to send out the post-build hooks
|
||||
await sleep(300);
|
||||
|
||||
try {
|
||||
core.debug('Waiting for Cachix daemon to exit...');
|
||||
await exec.exec(cachixBin, ["daemon", "stop", "--socket", `${daemonDir}/daemon.sock`]);
|
||||
} finally {
|
||||
// Wait a bit for the logs to flush through
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
await sleep(1000);
|
||||
daemonLog.unwatch();
|
||||
}
|
||||
|
||||
|
@ -433,6 +436,10 @@ function splitArgs(args: string): string[] {
|
|||
return args.split(' ').filter((arg) => arg !== '');
|
||||
}
|
||||
|
||||
async function sleep(ms: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
const isPost = !!core.getState('isPost');
|
||||
|
||||
// Main
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue