|
|
@@ -667,7 +667,7 @@ const updateSolutions = (solutions) => {
|
|
|
|
|
|
if (solutions?.length) {
|
|
|
const solutionsHistory = GAMES.Solutions;
|
|
|
- const updateIds = { add: [], update: [] }
|
|
|
+ const updateIds = { add: [], update: [], retain: [] }
|
|
|
solutions.forEach(item => {
|
|
|
const { sid, cpr, sol: { win_average } } = item;
|
|
|
|
|
|
@@ -685,18 +685,21 @@ const updateSolutions = (solutions) => {
|
|
|
}
|
|
|
|
|
|
const { timestamp } = item;
|
|
|
- solutionsHistory[sid].timestamp = timestamp;
|
|
|
-
|
|
|
+ historySolution.timestamp = timestamp;
|
|
|
+ updateIds.retain.push(sid);
|
|
|
});
|
|
|
|
|
|
- if (updateIds.add.length || updateIds.update.length) {
|
|
|
- const solutionUpdate = {};
|
|
|
- Object.keys(updateIds).forEach(key => {
|
|
|
+ const solutionUpdate = {};
|
|
|
+ Object.keys(updateIds).forEach(key => {
|
|
|
+ if (key == 'retain') {
|
|
|
+ solutionUpdate[key] = updateIds[key];
|
|
|
+ }
|
|
|
+ else {
|
|
|
solutionUpdate[key] = updateIds[key].map(sid => solutionsHistory[sid]);
|
|
|
- });
|
|
|
- syncSolutions(solutionUpdate);
|
|
|
- // Logs.outDev('solutions history update', solutionUpdate);
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ syncSolutions(solutionUpdate);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|