File tree Expand file tree Collapse file tree 3 files changed +3
-39
lines changed Expand file tree Collapse file tree 3 files changed +3
-39
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ const forceStatelyMembershipIds = new Set([
140
140
1234 ,
141
141
] ) ;
142
142
143
- const dialPercentage = 0.1 ; // 0 - 1.0
143
+ const dialPercentage = 0.2 ; // 0 - 1.0
144
144
145
145
// This would be better as a uniform hash but this is good enough for now
146
146
function isUserDialedIn ( bungieMembershipId : number ) {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import { importHashTags } from '../stately/item-hash-tags-queries.js';
30
30
import { importLoadouts } from '../stately/loadouts-queries.js' ;
31
31
import { importSearches } from '../stately/searches-queries.js' ;
32
32
import { convertToStatelyItem } from '../stately/settings-queries.js' ;
33
- import { batches , findNegativeNumbers } from '../stately/stately-utils.js' ;
33
+ import { batches } from '../stately/stately-utils.js' ;
34
34
import { importTriumphs } from '../stately/triumphs-queries.js' ;
35
35
import { badRequest , subtractObject } from '../utils.js' ;
36
36
import { deleteAllData } from './delete-all-data.js' ;
@@ -264,13 +264,7 @@ export async function statelyImport(
264
264
265
265
// OK now put them in as fast as we can
266
266
for ( const batch of batches ( items ) ) {
267
- try {
268
- await client . putBatch ( ...batch ) ;
269
- } catch ( e ) {
270
- findNegativeNumbers ( batch ) ;
271
- console . error ( 'Stately error importing batch' , e , batch ) ;
272
- throw e ;
273
- }
267
+ await client . putBatch ( ...batch ) ;
274
268
}
275
269
276
270
return numTriumphs ;
Original file line number Diff line number Diff line change @@ -138,33 +138,3 @@ export function* batches<T>(input: T[]): Generator<T[]> {
138
138
yield input . slice ( i * STATELY_MAX_BATCH_SIZE , ( i + 1 ) * STATELY_MAX_BATCH_SIZE ) ;
139
139
}
140
140
}
141
-
142
- export function findNegativeNumbers ( batch : any [ ] ) {
143
- for ( const item of batch ) {
144
- try {
145
- recursiveNegative ( item ) ;
146
- } catch ( e ) {
147
- console . error ( e ) ;
148
- }
149
- }
150
- }
151
-
152
- function recursiveNegative < T > ( value : T ) : void {
153
- if ( typeof value === 'number' ) {
154
- if ( value === - 1 ) {
155
- throw new Error ( value . toString ( ) ) ;
156
- }
157
- } else if ( Array . isArray ( value ) ) {
158
- return value . forEach ( recursiveNegative ) ;
159
- } else if ( typeof value === 'object' ) {
160
- for ( const [ key , val ] of Object . entries ( value as Record < string , unknown > ) ) {
161
- try {
162
- recursiveNegative ( val ) ;
163
- } catch ( e ) {
164
- if ( e instanceof Error ) {
165
- throw new Error ( `${ key } : ${ e . message } ` ) ;
166
- }
167
- }
168
- }
169
- }
170
- }
You can’t perform that action at this time.
0 commit comments