aiden-shared-calculations-unified 1.0.49 → 1.0.51
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.
|
@@ -105,7 +105,7 @@ class UserProfitabilityTracker {
|
|
|
105
105
|
|
|
106
106
|
const shardKey = `user_profitability_shard_${shardIndex}`;
|
|
107
107
|
if (!results[shardKey]) results[shardKey] = {};
|
|
108
|
-
results[shardKey][userId] = userHistory.slice(-7);
|
|
108
|
+
results[shardKey][userId] = { history: userHistory.slice(-7) };
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
return {
|
package/package.json
CHANGED
package/utils/firestore_utils.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Provides a resilient retry wrapper for Firestore operations.
|
|
3
3
|
*/
|
|
4
|
-
const { logger } = require("sharedsetup")(__filename);
|
|
4
|
+
const { logger } = require("sharedsetup")(__filename);
|
|
5
5
|
|
|
6
6
|
// Firestore error codes that are safe to retry
|
|
7
7
|
const RETRYABLE_ERROR_CODES = new Set([
|
|
8
|
-
'DEADLINE_EXCEEDED',
|
|
9
|
-
'UNAVAILABLE',
|
|
10
|
-
'INTERNAL',
|
|
11
|
-
'RESOURCE_EXHAUSTED', // Can indicate contention
|
|
8
|
+
'DEADLINE_EXCEEDED', 4,
|
|
9
|
+
'UNAVAILABLE', 14,
|
|
10
|
+
'INTERNAL', 13,
|
|
11
|
+
'RESOURCE_EXHAUSTED', 8, // Can indicate contention
|
|
12
12
|
]);
|
|
13
13
|
|
|
14
14
|
const MAX_RETRIES = 5;
|