-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate core logic of importchannel to a utility function and update associated tasks #13099
base: develop
Are you sure you want to change the base?
Migrate core logic of importchannel to a utility function and update associated tasks #13099
Conversation
@@ -587,15 +581,11 @@ def diskimport( | |||
drive = get_mounted_drive_by_id(drive_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is duplicated at line 594. Is it a bug or is there any purpose for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a bug, but it definitely looks unnecessary the second time. Probably just copy pasted from somewhere else.
logger = logging.getLogger(__name__) | ||
|
||
|
||
def start_file_transfer(job, filetransfer, channel_id, dest, no_upgrade, contentfolder): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For both of these functions, I would like it if we did not pass in job
as a first argument, and instead invoked get_current_job
inside the function itself.
What you would then need is a dummy job in the case where the function is not running in a task runner context, that just does a noop for all the methods of the job class (this way you don't need to keep on checking if the job exists or not).
This makes sense so far, I'd want the test updated, and not just skipped, before we merge, and I think not passing in the job into the functions is preferable - because that will eventually allow us to phase out the AsyncCommand class (passing the |
Thank you @rtibbles . I will update it by tomorrow:) |
Build Artifacts
|
Updated the utils functions as well as importchannel tests |
Summary
This refactors the importchannel command and its related tasks
References
Fixes #13095
Subtask of #9266
Reviewer guidance
NA