An action script for All User
2 2

9 posts in this topic

Hi and welcome to the forums!

Yes, it is absolutely possible and there are two things involved here:

1. The action script runs centralised on a machine somewhere at the company. So in this case you would not run it inside Connect but centralised somewhere.

2. The action script is discoverable to all users and not targeting a specific user. So omitting the filtering on user that is highlighted in this link: http://ftrack.rtd.ftrack.com/en/stable/developing/actions.html?highlight=source.user.username=

Share this post


Link to post
Share on other sites
On 11/19/2016 at 9:57 AM, fauzi said:

Hello, is there way to close session in ftrack, such session.close(). I think it very necessary. Thanks Mattias.

What is your use-case for closing the session? If you have a long running script that creates multiple sessions rapidly it may be a good idea, especially to disconnect the event hub: session.event_hub.disconnect()

Share this post


Link to post
Share on other sites

I have bad behavour user/uploader which put images on single directory and upload concurrently, hundreds/thousand images/videos. I modify your image_encoder action and send it to celery-redis 31 workers,i create a new session on it.

Share this post


Link to post
Share on other sites

If you want to close a session early you have to use the private session._request and run session._request.close()

When creating a lot of sessions it is a good idea to not have them connecting to the event_hub by setting auto_connect_event_hub to False when creating the session:

ftrack_api.Session(..., auto_connect_event_hub=False)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2