Variable Backup Files Purger
Description
This PR allows Skript to purge backup files, if number of files is >= required and will delete files starting from the oldest until number of files left = remain
Target Minecraft Versions: any Requirements: none Related Issues: none
Feature does work as intended, including:
-1 being disabled
# > 0 Delete oldest files until equals #
0 Delete all files + not starting backup task
Feature does work as intended, including:
-1being disabled# > 0Delete oldest files until equals#0Delete all files + not starting backup task
How’s the performance? Any lag spikes, etc?
How’s the performance? Any lag spikes, etc?
I didnt see/witness any lag spikes, then again, it was tested on a localhost
can we add tests? i know its not gonna be super simple, but this seems like a feature which we definitely want to be sure works as intended
I want to add that backups get created even when there are no variables in the database. CSV Fuse has an issue about it.
can we add tests?
I'm honestly not sure how to go about doing that. I've never done tests before, and from what I've seen, the tests are in Skript rather than Java. Plus, the main aspect relies on the setting within the config.
I want to add that backups get created even when there are no variables in the database
If you want, I can add within startBackupTask if the bytes of the variables.csv file is equal to 0, then it wont create a backup.
Only problem is, if all global vars get deleted, you will still have the commented info at the top, which varies of how many bytes based on the characters.
Edit: After some thought, I dont like this idea, seems bad, like me
I want to add that backups get created even when there are no variables in the database. CSV Fuse has an issue about it.
The issue spoken of and this pr I believe should be left as standalone relations. The code iirc already is suppose to prevent it the issue lies within ram variables counting towards a saved variable. Which until a proper system for ram vars is implemented there's little safety methods possible. #6609 is a much better starting point for that issue until further efforts are put in
I'm honestly not sure how to go about doing that. I've never done tests before, and from what I've seen, the tests are in Skript rather than Java. Plus, the main aspect relies on the setting within the config.
you can write tests in Java using the junit testing system. I can give it a shot if you dont mind