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