Jump to content

Backlog processing


tokejepsen

Recommended Posts

I've made an ftrack event processor, which loads plugins from a folder and processes events. Its based on the eventhub, so nothing new just a simpler collected workflow.

 

I wanted to add the ability to process backlog events, when/if the processor is offline. Found this; http://ftrack.rtd.ftrack.com/en/latest/developing/api_reference/index.html?highlight=events#ftrack.getActivityEvents, but the documentation has left me in the dark. Could I get an example of getting a backlog from a certain time?

Link to comment
Share on other sites

Yes the ftrack.getActivityEvents can be used to retrieve events from a certain project after a date or using the incremental id.

 

# This will give you events a maximum of 100 from a project, after a datetime.

events = ftrack.getActivityEvents(<project-id>, fromDate=<datetime>, limit=100)

 

# Process events

 

Please let us know if this doesn't work and if there are any issues using that method.

Link to comment
Share on other sites

yeah, the events I get back are quite different from the events when using the EventHub. They all seem to be social events with no entities iterate over. Example:

<social_event('{'insert': 'update', 'socialid': 299536, 'object': None, 'userid': 'b0fdb9ba-b037-11e4-ac9f-040112b6a801', 'created_at': <DateTime '20150213T16:55:46' at 361dd88>, 'entityType': 'socialevent', 'parent_type': 'task', 'showid': '26d1ccf6-b07b-11e4-b40c-040112b6a801', 'parent_id': '8e9464b6-b39b-11e4-9497-040112b6a801', 'rabbit': True, 'action': 'change.status.shot', 'entityId': 299536, 'data': {'statusid': {'new': '123b9f74-aaea-11e4-b051-040112b6a801', 'old': '1639e788-aaeb-11e4-8b45-040112b6a801'}}, 'id': '27d15ff8-b3a1-11e4-a321-040112b6a801'}')>

How would I convert this to a more "understandable" event that we know from the EventHub?

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Looking forward it would be interesting to look into having a recorded history of the events at our side. But for now I would recommend sticking to the event system and monitor the machine the script is running on and take steps to make sure it stays up. You could even set up something at your end that puts the events in to a persisted queue for further processing so that the event listener is very minimalistic and robust.

Link to comment
Share on other sites

So I ended up rethinking the whole setup we have here about relying on a single machine. Backlog processing is still a bit of concern but the main problem was that we didn't have any measure for when the machine goes down, and nobody notices before things go wrong and lots of events have been "lost".

The solution was to put the script onto Deadline, which handles if the machine goes down. When the machine goes down or the script fails for some reason, it'll switch machine and get the script up and running fairly fast.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...