[fix] transmission: allow from_task with multiple servers#3353
[fix] transmission: allow from_task with multiple servers#3353soloam wants to merge 4 commits intoFlexget:developfrom
Conversation
|
Hmm. This is why we don't like |
|
I suppose both of these solutions break if you do something like: inputs:
- from_transmission: hostA
- from_transmission: hostB |
|
Why are we even storing client instance like this? Shouldn't it just be created and closed in task_input (for from_transmission) and task_output (for regular transmission?) |
|
I think that the main reason is to reuse the same connection if you use input and output or download (or all of them) in the same task. But now that I see it, like this you can't input from one server and output from another! I also don't like to do this in the task start. One better way would be to start in the stages, and stor it in the task, and on each starge check if the config is the same, and if yes refuse, if not connect again. This also would solve the from A and from B, because it would compare the config and see that it's different, and disconnect and connect again |
|
I tried to re-trigger the checks, but something seams wrong! Locally was ok. I changed the code to get get the client connection on every stage and store it to latter check if can be reused or make a new connection. |
| return config | ||
|
|
||
| def create_rpc_client(self, config): | ||
| def create_rpc_client(self, config) -> transmissionrpc.Client: |
There was a problem hiding this comment.
| def create_rpc_client(self, config) -> transmissionrpc.Client: | |
| def create_rpc_client(self, config) -> 'transmissionrpc.Client': |
This is probably the reason for the test failures.
|
Thanks for this! Went with #3359 instead, as it seemed a bit simpler. |
Motivation for changes:
More that one instance of transmission was not possible to use in plugin from_task
Detailed changes:
Addressed issues: