fix(migration): declare write_cache_format_file before ensure_runtime_cache_format (no hoisting in ucode)
This commit is contained in:
@@ -1486,6 +1486,13 @@ function ensure_runtime_dirs() {
|
||||
ensure_dir(TACHYON_SECTION_CACHE_DIR);
|
||||
}
|
||||
|
||||
function write_cache_format_file(path, format) {
|
||||
let tmp = path + ".tmp";
|
||||
if (fs.writefile(tmp, format + "\n") == null)
|
||||
return null;
|
||||
return fs.rename(tmp, path) ? path : null;
|
||||
}
|
||||
|
||||
function ensure_runtime_cache_format() {
|
||||
ensure_dir(TACHYON_RUNTIME_STATE_DIR);
|
||||
|
||||
@@ -1508,13 +1515,6 @@ function ensure_runtime_cache_format() {
|
||||
}
|
||||
}
|
||||
|
||||
function write_cache_format_file(path, format) {
|
||||
let tmp = path + ".tmp";
|
||||
if (fs.writefile(tmp, format + "\n") == null)
|
||||
return null;
|
||||
return fs.rename(tmp, path) ? path : null;
|
||||
}
|
||||
|
||||
function remove_legacy_server_country_cache() {
|
||||
// Absent file already satisfies the caller; fs.unlink throws on ENOENT.
|
||||
try { fs.unlink(TACHYON_RUNTIME_STATE_DIR + "/server-country-cache.json"); } catch(e) {}
|
||||
|
||||
Reference in New Issue
Block a user