Skip to content
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

Add a small delay to allow post-build hooks to flush through #196

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28935,6 +28935,8 @@ async function upload() {
fromBeginning: true,
});
daemonLog.on("line", (line) => core.info(line));
// Give the Nix daemon/socket some time to flush all the post-build hooks
await waitFor(500);
try {
core.debug("Waiting for Cachix daemon to exit...");
await exec.exec(cachixBin, [
Expand All @@ -28946,7 +28948,7 @@ async function upload() {
}
finally {
// Wait a bit for the logs to flush through
await new Promise((resolve) => setTimeout(resolve, 1000));
await waitFor(1000);
daemonLog.unwatch();
}
break;
Expand Down Expand Up @@ -29119,6 +29121,9 @@ function partitionUsersAndGroups(mixedUsers) {
function splitArgs(args) {
return args.split(" ").filter((arg) => arg !== "");
}
function waitFor(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
const isPost = !!core.getState("isPost");
// Main
try {
Expand Down
9 changes: 8 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ async function upload() {
});
daemonLog.on("line", (line) => core.info(line));

// Give the Nix daemon/socket some time to flush all the post-build hooks
await waitFor(500);

try {
core.debug("Waiting for Cachix daemon to exit...");
await exec.exec(cachixBin, [
Expand All @@ -271,7 +274,7 @@ async function upload() {
]);
} finally {
// Wait a bit for the logs to flush through
await new Promise((resolve) => setTimeout(resolve, 1000));
await waitFor(1000);
daemonLog.unwatch();
}

Expand Down Expand Up @@ -490,6 +493,10 @@ function splitArgs(args: string): string[] {
return args.split(" ").filter((arg) => arg !== "");
}

function waitFor(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}

const isPost = !!core.getState("isPost");

// Main
Expand Down
Loading