Add information to be sure we have all messages

This commit is contained in:
Mickael 2019-09-04 17:39:46 +02:00
parent e2b75d6cc5
commit 80bf0769ac
3 changed files with 4 additions and 4 deletions

View file

@ -37,8 +37,8 @@ def getAllChannels(rocket):
index += channels['count']
return allChannels
def getAllMessages(rocket, roomid, begindate=None, enddate=datetime.now()):
result = rocket.channels_history(roomid, oldest= begindate, latest= enddate, count= 10000).json()
def getAllMessages(rocket, roomid, begindate=None, enddate=datetime.now(), count=10000):
result = rocket.channels_history(roomid, oldest= begindate, latest= enddate, count= count).json()
if result["success"]:
#filter system message
return list(filter(lambda message: "t" not in message, result["messages"]))

View file

@ -63,7 +63,7 @@ def main():
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)
for id in range(0, nbElements):

File diff suppressed because one or more lines are too long