Complete filter #2
Reference in New Issue
Block a user
Delete Branch "complete-filter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: GotPPay
Created by: MirnaM
No need for two if statements, you can use &&
Created by: MirnaM
there is a lot of nesting here. can you extract some of the blocks to separate methods, maybe this one
Created by: MirnaM
Maybe extract this callback to a method processDomains, and call it in getRawDomainList?
Created by: MirnaM
This is hard to read. Maybe you can split this callback into few methods that do it's own thing, for example comparing domains with yesterday, and removing domains from expired list can be separate methods. Also, no need to pass this as a parameter
Created by: MirnaM
Maybe move this map to cleanExpired, and add expired domains to array, and then call insert on resulting array. This will cause insert to be called only once, not one time for every domain, since db.collection.insert accepts array of documents. This way only one promise will be returned.
Created by: MirnaM
This will be resolved before db insert is finished. do db.collection('expired_list').insert(domains, () => {resolve();}) if there are expired domains
Created by: MirnaM
If there are expired domains, this will be resolved before http.get is finished.
Created by: MirnaM
No need to wrap this in promise
Created by: MirnaM
No need to wrap this in promise
Created by: MirnaM
maybe push to an array, and after all domains are checked call remove in the end. you can write query with $in
Created by: GotPPay
This removal was wrong, since it removed all domains, not checking TLD (.se or .nu or .com), and with new filter, I don't know is it practical to separate different domains in different arrays to remove using $in query