Skip to content

break apart threadedUploadLoop

David Vorick requested to merge uploadheap into unstable

threadedUploadLoop has been renamed to threadedUploadAndRepair, because it is the thread in charge of both uploading new files and repairing existing files.

The previous function has been split into two separate functions. The first function, the original, runs an infinite loop where it checks for all of the required conditions before performing repairs, and then executes the repairs. This outer function is also in charge of managing any sleeps or blocking that should occur as a result of errors.

All of the logic pertaining to actually finding a directory and performing a repair has been split into a new function, managedUploadAndRepiar. This was done to simplify the logic of the outer function, to make it more readable and easier to understand the full control flow of the repair loop, without repair logic masking where the sleeps and error handling logic is.

The constants file has been reorganized so that the constants are grouped by function, each group having a docstring explaining what the group relates to. The idea was to make the constants file easier to read, and to make it easier to find variables related to whatever renter logic you are currently working with.

Edited by Matthew Sevey

Merge request reports