Add information to be sure we have all messages
This commit is contained in:
parent
e2b75d6cc5
commit
80bf0769ac
3 changed files with 4 additions and 4 deletions
|
@ -37,8 +37,8 @@ def getAllChannels(rocket):
|
||||||
index += channels['count']
|
index += channels['count']
|
||||||
return allChannels
|
return allChannels
|
||||||
|
|
||||||
def getAllMessages(rocket, roomid, begindate=None, enddate=datetime.now()):
|
def getAllMessages(rocket, roomid, begindate=None, enddate=datetime.now(), count=10000):
|
||||||
result = rocket.channels_history(roomid, oldest= begindate, latest= enddate, count= 10000).json()
|
result = rocket.channels_history(roomid, oldest= begindate, latest= enddate, count= count).json()
|
||||||
if result["success"]:
|
if result["success"]:
|
||||||
#filter system message
|
#filter system message
|
||||||
return list(filter(lambda message: "t" not in message, result["messages"]))
|
return list(filter(lambda message: "t" not in message, result["messages"]))
|
||||||
|
|
|
@ -63,7 +63,7 @@ def main():
|
||||||
|
|
||||||
tsunamy = getTsunamy(channel)
|
tsunamy = getTsunamy(channel)
|
||||||
|
|
||||||
messages = getAllMessages(rocket, channel['_id'], begindate= begin, enddate= end)
|
messages = getAllMessages(rocket, channel['_id'], begindate= begin, enddate= end, count= channel["msgs"])
|
||||||
end = begin + timedelta(1)
|
end = begin + timedelta(1)
|
||||||
|
|
||||||
for id in range(0, nbElements):
|
for id in range(0, nbElements):
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue