bulltrackers-module 1.0.179 → 1.0.180
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.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* (REFACTORED: Removed all concurrency from `handleUpdate` and `lookupUsernames`)
|
|
4
4
|
* (REFACTORED: Added node-fetch fallback for all API calls)
|
|
5
5
|
* (REFACTORED: Added verbose, user-centric logging for all operations)
|
|
6
|
+
* (FIXED: Corrected variable name 'instId' to 'instrumentId' in final timestamp loops)
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
9
|
const { FieldValue } = require('@google-cloud/firestore');
|
|
@@ -174,9 +175,12 @@ async function handleUpdate(task, taskId, { logger, headerManager, proxyManager,
|
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
// --- 5. Handle Private Users & Timestamps ---
|
|
178
|
+
// FIXED: Corrected variable naming here from 'instId' to 'instrumentId'
|
|
177
179
|
if (isPrivate) {
|
|
178
180
|
logger.log('WARN', `[handleUpdate/${userId}] Removing private user from updates.`);
|
|
179
|
-
for (const instrumentId of instrumentsToProcess) {
|
|
181
|
+
for (const instrumentId of instrumentsToProcess) {
|
|
182
|
+
await batchManager.deleteFromTimestampBatch(userId, userType, instrumentId);
|
|
183
|
+
}
|
|
180
184
|
const blockCountsRef = db.doc(config.FIRESTORE_DOC_SPECULATOR_BLOCK_COUNTS);
|
|
181
185
|
for (const instrumentId of instrumentsToProcess) {
|
|
182
186
|
const incrementField = `counts.${instrumentId}_${Math.floor(userId/1e6)*1e6}`;
|
|
@@ -186,7 +190,11 @@ async function handleUpdate(task, taskId, { logger, headerManager, proxyManager,
|
|
|
186
190
|
}
|
|
187
191
|
|
|
188
192
|
// If not private, update all timestamps
|
|
189
|
-
|
|
193
|
+
// FIXED: Corrected variable naming here from 'instId' to 'instrumentId'
|
|
194
|
+
for (const instrumentId of instrumentsToProcess) {
|
|
195
|
+
await batchManager.updateUserTimestamp(userId, userType, instrumentId);
|
|
196
|
+
}
|
|
197
|
+
|
|
190
198
|
if (userType === 'speculator') { await batchManager.addSpeculatorTimestampFix(userId, String(Math.floor(userId/1e6)*1e6)); }
|
|
191
199
|
|
|
192
200
|
logger.log('INFO', `[handleUpdate/${userId}] Update task finished successfully.`);
|