smoltalk 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getLogger } from "../logger.js";
|
|
1
2
|
import { BaseStrategy } from "./baseStrategy.js";
|
|
2
3
|
export class RaceStrategy extends BaseStrategy {
|
|
3
4
|
strategies;
|
|
@@ -28,8 +29,11 @@ export class RaceStrategy extends BaseStrategy {
|
|
|
28
29
|
});
|
|
29
30
|
return Promise.race(promises.map((p, i) => p.then((result) => {
|
|
30
31
|
for (let j = 0; j < controllers.length; j++) {
|
|
31
|
-
if (j !== i)
|
|
32
|
+
if (j !== i) {
|
|
33
|
+
const logger = getLogger();
|
|
34
|
+
logger.debug(`RaceStrategy: aborting strategy ${this.strategies[j]} because strategy ${this.strategies[i]} won the race.`);
|
|
32
35
|
controllers[j].abort();
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
return result;
|
|
35
39
|
})));
|