Switch to asynchronous job handling
Both receive
and check
methods trigger basically the same operation to the file mover. It is preferable to split the functionality into receive
, which starts the upload procedure, and check
, which checks on the status of the upload. You can see this behaviour on the TOS Agent or the CDSTAR Upload Agent.
Changing to this behaviour requires the agent to have some kind of lookup mechanism on the state of file uploads and / or proper handling of errors. You may implement a database for that (like TOS Agent or CDSTAR Upload Agent do) or go into other solutions like Celery.
Note that this change is non-trivial and requires quite some testing. Keep in mind that one agent instance is usually used by multiple agents within AW which need to be separated properly.