Skip to content

Commit

Permalink
fix(action): use async
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Mar 30, 2024
1 parent 15b8453 commit a8db2d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/utils/mergeStoreDatabases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { exec } from "@actions/exec";
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "fs";
import Handlebars from "handlebars";

export function mergeStoreDatabases(
export async function mergeStoreDatabases(
tempDir: string,
dbPath1: string,
dbPath2: string,
Expand All @@ -17,5 +17,5 @@ export function mergeStoreDatabases(
const template = Handlebars.compile(mergeSqlTemplate);
writeFileSync(mergeSqlFile, template({ dbPath1, dbPath2 }));

exec(`sqlite3 ${dbPath} ${mergeSqlFile}`);
await exec(`sqlite3 ${dbPath} ${mergeSqlFile}`);
}
4 changes: 2 additions & 2 deletions src/utils/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export async function restoreCache(key: string, ref?: string) {
`
);

mergeStoreDatabases(tempDir, dbPath1, dbPath2, dbPath);
await mergeStoreDatabases(tempDir, dbPath1, dbPath2, dbPath);

utils.info(`Checking the store database.`);

await exec(`sqlite3 "${dbPath}" "PRAGMA integrity_check;"`);
await exec(`sqlite3 "${dbPath}" 'PRAGMA integrity_check;'`);
}

return cacheKey;
Expand Down

0 comments on commit a8db2d6

Please sign in to comment.