Closed anversoft closed 2 years ago
Ciao @anversoft,
thank you for this PR, great catch! I think that a better and most efficient solution could be using deleteMany
to delete entries, something like
this._dbModel.deleteMany({ id: { $in: deletedRevokedUvci }})
Try and let me know, in case could you please rewrite that part using deleteMany
?
Merging #24 (71c4773) into master (55a43bd) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #24 +/- ##
=======================================
Coverage 97.98% 97.98%
=======================================
Files 8 8
Lines 398 398
=======================================
Hits 390 390
Misses 8 8
Impacted Files | Coverage Δ | |
---|---|---|
src/service.js | 95.77% <ø> (ø) |
|
src/cache.js | 100.00% <100.00%> (ø) |
|
src/crl.js | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 55a43bd...71c4773. Read the comment docs.
Ok, i tried a few times and now it works fine. I removed the env variable VC19_MONGODB_CLEAN_THRESHOLD
because with deleteMany
it is no longer necessary but I added the env variable VC19_UPDATE_HOURS
to force the check of the clr since the revoked certificates are updated every 5/6 hours
Great @anversoft ! Thank you so much!
When the revoked certificates are too many (> 50000) MongoDB takes too long to delete the certificates (+ 2h), I found it more efficient to completely delete the database and download the new certificates instead of deleting them one by one, the clean up threshold can be set using the env variable
VC19_MONGODB_CLEAN_THRESHOLD
(default 50000).