@@ -67,6 +67,9 @@ Promise.all(
6767 count = await drillDb . collection ( "drill_events" + crypto . createHash ( 'sha1' ) . update ( "[CLY]_crash" + app . _id ) . digest ( 'hex' ) ) . countDocuments ( { ts : { $lt : lastUnixTimestamp * 1000 } } ) ;
6868 console . log ( "" , count , "drill crashes to be deleted via command" ) ;
6969 console . log ( "" , "" , "" , `db.drill_events${ crypto . createHash ( 'sha1' ) . update ( "[CLY]_crash" + app . _id ) . digest ( 'hex' ) } .deleteMany({ ts: { $lt: ${ lastUnixTimestamp * 1000 } } })` ) ;
70+ var count2 = await drillDb . collection ( "drill_events" ) . countDocuments ( { "a" : app . _id + "" , "e" : "[CLY]_crash" , ts : { $lt : lastUnixTimestamp * 1000 } } ) ;
71+ console . log ( "" , count2 , "drill crashes to be deleted via command" ) ;
72+ console . log ( "" , "" , "" , `db.drill_events.deleteMany({"a": ${ app . _id } , "e": "[CLY]_crash", ts: { $lt: ${ lastUnixTimestamp * 1000 } } })` ) ;
7073 checkThreshold ( count ) ;
7174 }
7275 else {
@@ -77,7 +80,10 @@ Promise.all(
7780 res = await db . collection ( `app_crashes${ app . _id } ` ) . deleteMany ( { ts : { $lt : lastUnixTimestamp } } ) ;
7881 console . log ( "" , res , "crashes deleted" ) ;
7982 await sleep ( SLEEP ) ;
83+ //deleting from old collection
8084 res = await drillDb . collection ( "drill_events" + crypto . createHash ( 'sha1' ) . update ( "[CLY]_crash" + app . _id ) . digest ( 'hex' ) ) . deleteMany ( { ts : { $lt : lastUnixTimestamp * 1000 } } ) ;
85+ //deleting from amerged drill collection
86+ res = await drillDb . collection ( "drill_events" ) . deleteMany ( { "a" : app . _id + "" , "e" : "[CLY]_crash" , ts : { $lt : lastUnixTimestamp * 1000 } } ) ;
8187 console . log ( "" , res , "drill crashes deleted" ) ;
8288 await sleep ( SLEEP ) ;
8389 }
0 commit comments