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.
Unfortunately, there’s no way to alter when a Job’s
is updated. However, it should be possible to run an Event Script on the
post_cmd_outputevent rather than
post_cmd_job. That would run the script post output but before Templater updates the
render-statusvalue in the data source. It would also need to be run synchronously in order to ensure that the script finishes before the
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.
Have tried it configuring it so it runs the script on
post_cmd_outputbut 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!
Hmmm. That’s quite odd. One thing to check would be to see what the value of
post_cmd_output_asyncis in the templater-options.json file. That key should be set to
falseto enable synchronous execution, which should keep the
post_cmd_jobaction from setting the
doneuntil 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 firstname.lastname@example.org