Save stores periodically instead of only on shutdown

Abierto
#71 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
backend

Línea de trabajo

Start by reading Warehouse and the configuration loading code, then find where the plugin schedules recurring tasks and how stores are saved. Add the interval to config.yml and follow the issue’s atomic-write and failed-load safeguards. Done means store changes are saved within the configured interval without shutdown, with a test confirming the schedule.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Problem

Stores are only saved when the plugin shuts down cleanly. After a crash, a power loss or a killed process, every store change since the last start is lost.

Player money is stored by the economy plugin and survives, so the two can disagree. A player keeps the items they bought or the money from a sale, while the store goes back to its old stock and balance.

SQLite storage (#52) fixes this for 1.0, but 0.4.0 needs a smaller safeguard until then.

Scope

  • Save on a repeating task, for example every 5 minutes, with the interval in config.yml.
  • Keep the file write safe if the server dies during a save. HoconConfigurationLoader already writes atomically when given a file.
  • Don't save if the load failed, which Warehouse already protects against.

Done when

  • Store changes are written within the configured interval without a shutdown.
  • A test confirms the save runs on the schedule.
Lenguaje dominante
Java
Estrellas
1
Forks
0
Merge medio
2 h 35 min
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de BrendonButler/Shops

Todos los issues de BrendonButler/Shops

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.