Some checks failed
Release S-UI / build-frontend (push) Failing after 1m53s
Release S-UI / build-386 (push) Has been skipped
Release S-UI / build-amd64 (push) Has been skipped
Release S-UI / build-armv5 (push) Has been skipped
Release S-UI / build-armv6 (push) Has been skipped
Release S-UI / build-armv7 (push) Has been skipped
Release S-UI / build-s390x (push) Has been skipped
Release S-UI / build-arm64 (push) Has been skipped
Build S-UI for Windows / build-frontend (push) Failing after 2s
Build S-UI for Windows / build-windows-amd64 (push) Has been skipped
Build S-UI for Windows / build-windows-arm64 (push) Has been skipped
Signed-off-by: Pavel Kirilin <s3riussan@gmail.com>
20 lines
402 B
Go
20 lines
402 B
Go
package cronjob
|
|
|
|
import (
|
|
"github.com/alireza0/s-ui/database"
|
|
"github.com/alireza0/s-ui/logger"
|
|
)
|
|
|
|
type WALCheckpointJob struct{}
|
|
|
|
func NewWALCheckpointJob() *WALCheckpointJob {
|
|
return &WALCheckpointJob{}
|
|
}
|
|
|
|
func (s *WALCheckpointJob) Run() {
|
|
db := database.GetDB()
|
|
if err := db.Exec("PRAGMA wal_checkpoint(FULL)").Error; err != nil {
|
|
logger.Error("Error checkpointing WAL: ", err.Error())
|
|
}
|
|
}
|