Templater not waiting for synchronous 'post_cmd_job' script to finish execution before marking job as done in data source.
-
Hello, is there any way I can make Templater only update the data source’s (Google Spreadsheet) row render status to “done” after the script “post_cmd_job” has finished execution? I’ve set “post_cmd_job_async” to false but it’s still doing it.
Thank you!
-
Unfortunately, there’s no way to alter when a Job’s
render-status
is updated. However, it should be possible to run an Event Script on thepost_cmd_output
event rather thanpost_cmd_job
. That would run the script post output but before Templater updates therender-status
value in the data source. It would also need to be run synchronously in order to ensure that the script finishes before therender-status
is updated.Hopefully, that helps with what you’re trying to achieve, but if you continue to run into problems, we’ll need to get some more information about what you’re attempting to do so we can make a more targeted suggestion.
Thanks!
-
Have tried it configuring it so it runs the script on
post_cmd_output
but it’s also not waiting for the script to finish. We currently have another application that periodically reads the data source to check if the row has been marked as “done” so it can pull a GCloud Storage asset, which is uploaded by the script in question. If the row is marked as “done” before the rendered output is uploaded to the bucket, when our app tries to fetch it, it doesn’t exist.We could solve for this by having the script communicate directly with our app stating that the upload had been completed and go from there, but are looking into a more elegant solution incorporating Templater if possible!
Thank you
-
Hmmm. That’s quite odd. One thing to check would be to see what the value of
post_cmd_output_async
is in the templater-options.json file. That key should be set tofalse
to enable synchronous execution, which should keep thepost_cmd_job
action from setting therender-status
todone
until the script is completed.If that doesn’t make any difference, we might need to get some additional information on what actions the script is performing. If that ends up being the case and you’d like to provide that information in a less public setting, please feel free to email our support channel directly at support@dataclay.com
Thanks!