Skip to content

Don't panic in the cleaner when there's nothing to clean - #6

Open
nickwolf wants to merge 1 commit into
CampingAvocado:mainfrom
nickwolf:fix/cleaner-empty-batch-panic
Open

Don't panic in the cleaner when there's nothing to clean#6
nickwolf wants to merge 1 commit into
CampingAvocado:mainfrom
nickwolf:fix/cleaner-empty-batch-panic

Conversation

@nickwolf

Copy link
Copy Markdown

The cleaner task dies on startup when there's nothing to clean:

thread 'tokio-runtime-worker' panicked at server/src/cleaner.rs:62:13:
index out of bounds: the len is 0 but the index is 0

process_batch returns early on a batch of one but not on an empty one, and run_library_cleaner calls it unconditionally after the loop.

process_batch returns early on a batch of one but not on an empty one, and
run_library_cleaner calls it unconditionally after the loop. With no torrents
to clean the batch is empty and batch[0] panics, killing the cleaner task on
startup:

  thread 'tokio-runtime-worker' panicked at server/src/cleaner.rs:62:13:
  index out of bounds: the len is 0 but the index is 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant