sort events by date there were stored

This commit is contained in:
iLLiCiTiT 2019-10-23 16:47:45 +02:00
parent 45370876e3
commit ac290711b9

View file

@ -6,6 +6,7 @@ import threading
import time
import requests
import queue
import pymongo
import ftrack_api
import ftrack_api.session
@ -74,7 +75,12 @@ class ProcessEventHub(ftrack_api.event.hub.EventHub):
break
def load_events(self):
not_processed_events = self.dbcon.find({"pype_data.is_processed": False})
not_processed_events = self.dbcon.find(
{"pype_data.is_processed": False}
).sort(
[("pype_data.stored", pymongo.ASCENDING)]
)
found = False
for event_data in not_processed_events:
new_event_data = {