mirror of
https://github.com/btdig/dhtcrawler2.git
synced 2025-01-31 02:21:37 +00:00
fix daterange issure which not only record today torrents, not it only show the today inserted torrents
This commit is contained in:
parent
4dc05bf2cc
commit
ec456de63d
@ -35,8 +35,8 @@ insert(Conn, Hash, ReqCnt, UpSert) when is_list(Hash) ->
|
||||
DaySecs = time_util:now_day_seconds(),
|
||||
BHash = list_to_binary(Hash),
|
||||
% only record today new inserted torrent
|
||||
Cmd = {findAndModify, ?COLLNAME, query, {'_id', BHash}, upsert, UpSert,
|
||||
update, {'$inc', {reqs, ReqCnt}, '$set', {?DATE_COL, DaySecs}}, fields, {'_id', 1}},
|
||||
Cmd = {findAndModify, ?COLLNAME, query, {'_id', BHash, ?DATE_COL, DaySecs}, upsert, UpSert,
|
||||
update, {'$inc', {reqs, ReqCnt}}, fields, {'_id', 1}},
|
||||
IRet = mongo:do(safe, master, Conn, ?DBNAME, fun() ->
|
||||
mongo:command(Cmd)
|
||||
end),
|
||||
|
Loading…
Reference in New Issue
Block a user