CloudNet-v2 icon indicating copy to clipboard operation
CloudNet-v2 copied to clipboard

Rework the scheduler and file utility

Open GiantTreeLP opened this issue 5 years ago • 1 comments

The scheduler is very weird and wastes resources. The TaskScheduler is very weirdly set up and requires major rewriting.

This is very noticable with long lasting tasks like copying a large template.

https://github.com/CloudNetService/CloudNet/blob/development/cloudnet-lib/src/main/java/de/dytanic/cloudnet/lib/utility/threading/Scheduler.java

https://github.com/CloudNetService/CloudNet/blob/development/cloudnet-lib/src/main/java/de/dytanic/cloudnet/lib/scheduler/TaskScheduler.java

It would be best to simply replace this large class with a ScheduledExecutorService

While we are at it, we should also rewrite the FileUtility to use ready-made methods directly from Java: https://github.com/CloudNetService/CloudNet/blob/development/cloudnet-wrapper/src/main/java/de/dytanic/cloudnetwrapper/util/FileUtility.java.

Current progress:

  • [x] FileUtility
  • [x] TaskScheduler

GiantTreeLP avatar Aug 12 '19 21:08 GiantTreeLP

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.94. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar Aug 12 '19 21:08 issue-label-bot[bot]