Skip to content

Commit fa59c88

Browse files
committed
feat: log hash mismatched projects at the end
1 parent e2e5659 commit fa59c88

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@jotforminc/zenith",
33
"packageManager": "pnpm@7.18.0",
4-
"version": "0.5.6",
4+
"version": "0.5.7",
55
"description": "",
66
"main": "./build/index.js",
77
"files": [

src/classes/BuildHelper.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class BuildHelper extends WorkerHelper {
1414
fromCache = 0;
1515
built = 0;
1616
missingProjects = [];
17+
hashMismatchProjects = [];
1718

1819
constructor(command) {
1920
super(command);
@@ -121,13 +122,15 @@ export default class BuildHelper extends WorkerHelper {
121122
for (const output of outputs) {
122123
// const outputPath = path.join(ROOT_PATH, root, output);
123124
Logger.log(3, 'Recovering from cache', buildProject, 'with hash => ', hash);
125+
const startTime = process.hrtime();
124126
const recoverResponse = await this.anotherJob(hash, root, output, script, this.compareHash, this.logAffected);
125127
if (recoverResponse instanceof Error) {
126128
throw new Error(recoverResponse);
127129
}
128130
if (!recoverResponse) {
129131
// TODO: will remove in for loop sorry for shitty code anyone who sees it :((
130132
await this.execute(buildPath, script, hash, root, outputs, buildProject);
133+
this.hashMismatchProjects.push({ buildProject, time: process.hrtime(startTime)});
131134
this.built++
132135
} else {
133136
this.fromCache++
@@ -162,6 +165,7 @@ export default class BuildHelper extends WorkerHelper {
162165
Logger.log(2, `${this.fromCache} projects used from cache,`);
163166
Logger.log(2, `${this.built} projects used without cache.`);
164167
Logger.log(2, `Cache is missing for following projects => ${formatMissingProjects(this.missingProjects)}`);
168+
Logger.log(2, `Hashes mismatched for following projects => ${formatMissingProjects(this.hashMismatchProjects)}`);
165169
Logger.log(2, `Total process took ${formatTimeDiff(process.hrtime(this.startTime))}.`);
166170
if (this.debug && process.env.ZENITH_DEBUG_ID) {
167171
this.cacher.updateDebugFile(Hasher.getDebugJSON(), this.command);

0 commit comments

Comments
 (0)