Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Variable Backup Files Purger

Open Absolutionism opened this issue 1 year ago • 8 comments

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

Absolutionism avatar Jul 02 '24 15:07 Absolutionism

Feature does work as intended, including: -1 being disabled # > 0 Delete oldest files until equals # 0 Delete all files + not starting backup task

Absolutionism avatar Aug 06 '24 20:08 Absolutionism

Feature does work as intended, including: -1 being disabled # > 0 Delete oldest files until equals # 0 Delete all files + not starting backup task

How’s the performance? Any lag spikes, etc?

EquipableMC avatar Aug 06 '24 20:08 EquipableMC

How’s the performance? Any lag spikes, etc?

I didnt see/witness any lag spikes, then again, it was tested on a localhost

Absolutionism avatar Aug 06 '24 20:08 Absolutionism

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

Pikachu920 avatar Aug 06 '24 23:08 Pikachu920

I want to add that backups get created even when there are no variables in the database. CSV Fuse has an issue about it.

TheLimeGlass avatar Aug 07 '24 00:08 TheLimeGlass

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

Absolutionism avatar Aug 07 '24 00:08 Absolutionism

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

Fusezion avatar Aug 07 '24 02:08 Fusezion

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

Pikachu920 avatar Aug 07 '24 23:08 Pikachu920