Skip to content

Commit

Permalink
Improve killswitch detection
Browse files Browse the repository at this point in the history
  • Loading branch information
atuchin-m committed Sep 20, 2023
1 parent f217538 commit cd2aad5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/study_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,14 @@ export class StudyDetails {
console.error('Bad study ' + JSON.stringify(study));
return;
}
this.isEmergency = study.name.match(/KillSwitch/) !== null;
const isKillSwitch = (s: string) => {
return s.match(/(K|k)ill(S|s)witch/) !== null;
};
this.isEmergency =
isKillSwitch(study.name) ||
study.experiment?.find(
(e) => e.probability_weight > 0 && isKillSwitch(e.name),
) !== undefined;

if (maxVersion != null) {
const parsed = parseVersionPattern(maxVersion);
Expand Down

0 comments on commit cd2aad5

Please sign in to comment.