jungsoft/uploadex

Remove task_after dependency

Closed this issue · 0 comments

Uploadex is using task_after (https://github.com/OvermindDL1/task_after) lib in the Uploadex.Storage.get_temporary_file/3 implementations (S3Storage and FileStorage) with the purpose of deleting a file after some delay.

Using this library has some disadvantages:

  • Another dependency to have (lib and user apps). Also the lib is not updated since 2019 (not a big problem because it seems stable)
  • Another setup that the user of the lib must do, configuring the TaskAfter (as it says in the README)

Although the TaskAfter has many features, we just use it for doing some action after a certain delay.

My proposal is to remove the lib and replace where we use it with the following code:

Task.start(fn ->
  Process.sleep(delay)
  call_function.()
end)