fix(subscription): fix read_json_file -> read_json in section_cache_has_outbounds
Incorrect function name caused a Type error crash in CI: 'left-hand side is not a function' Also replace for-in early-return trick with object_key_count() which already exists in this file (see line 1145).
This commit is contained in:
@@ -332,13 +332,11 @@ function cache_keep_sets(sections) {
|
||||
}
|
||||
|
||||
function section_cache_has_outbounds(section_cache_path) {
|
||||
let data = read_json_file(section_cache_path);
|
||||
let data = read_json(section_cache_path);
|
||||
if (type(data) != "object")
|
||||
return false;
|
||||
let names = object_or_empty(object_or_empty(data.outboundMetadata).names);
|
||||
for (let k in names)
|
||||
return true;
|
||||
return false;
|
||||
return object_key_count(names) > 0;
|
||||
}
|
||||
|
||||
function section_has_source_cache(name, section) {
|
||||
|
||||
Reference in New Issue
Block a user