You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ignore if file doesn't exist, it is only for debugging
1081
+
console.log(`Build cache not found, building now (downtime) please consider running npx adminforth bundle at build time to avoid downtimes at runtime`);
logsToDisplay.push(`Build cache exists but is outdated:`);
1089
+
for(const[file,hash]ofObject.entries(hashMap)){
1090
+
if(!parsedOldHashForFiles[file]){
1091
+
logsToDisplay.push(` - file ${file} - does not exist in cache but exists in runtime`);
1092
+
}elseif(parsedOldHashForFiles[file]!==hash){
1093
+
logsToDisplay.push(` - file ${file} - content in cache is different then in runtime`);
1094
+
}
1095
+
}
1096
+
/**
1097
+
* Currently we can't detect, if file was removed,
1098
+
* because we can only add files to the tpm folder but not remove them,
1099
+
* so if file existed before and now doesn't exist, we will not detect it
1100
+
*/
1101
+
1102
+
// for(const [file, hash] of Object.entries(parsedOldHashForFiles)) {
1103
+
// console.log(`checking file ${file} in old hash: ${hash}`);
1104
+
// console.log(`checking file ${file} in new hash: ${hashMap[file]}`);
1105
+
// if (!hashMap[file]) {
1106
+
// logsToDisplay.push(` - file ${file} - exists in cache but does not exist in runtime`);
1107
+
// }
1108
+
// }
1109
+
1110
+
logsToDisplay.push(`If you are running in production now, then the cache loss is a downtime issue.`);
1111
+
logsToDisplay.push(`If you have npx adminforth bundle in build time, then this issue might be caused by conditional instantiation of plugins:`)
1112
+
logsToDisplay.push(`Please avoid constructions like (process.env.SOME_KEY ? new Plugin(...) ) because if you will miss SOME_KEY in build time build cache and functionality fails.`);
1113
+
if(logsToDisplay.length>4){
1114
+
for(constlogoflogsToDisplay){
1115
+
console.log(log);
1116
+
}
1117
+
}
1118
+
}
1119
+
1031
1120
// TODO probably add option to build with tsh check (plain 'build')
0 commit comments