every hour delete and drone fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Elizabeth Hunt 2024-04-21 18:49:41 -07:00
parent d14605d138
commit bef72712c2
Signed by: simponic
GPG Key ID: 2909B9A7FF6213EE
2 changed files with 3 additions and 35 deletions

View File

@ -1,30 +1,9 @@
---
kind: pipeline
type: docker
name: build
steps:
- name: run tests
image: golang
commands:
- go build
- go test -p 1 -v ./...
trigger:
event:
- pull_request
--- ---
kind: pipeline kind: pipeline
type: docker type: docker
name: deploy name: deploy
steps: steps:
- name: run tests
image: golang
commands:
- go build
- go test -p 1 -v ./...
- name: docker - name: docker
image: plugins/docker image: plugins/docker
settings: settings:
@ -32,19 +11,8 @@ steps:
from_secret: gitea_packpub_username from_secret: gitea_packpub_username
password: password:
from_secret: gitea_packpub_password from_secret: gitea_packpub_password
registry: git.hatecomputers.club registry: git.simponic.xyz
repo: git.hatecomputers.club/hatecomputers/hatecomputers.club repo: git.simponic.xyz/simponic/backup-notify
- name: ssh
image: appleboy/drone-ssh
settings:
host: hatecomputers.club
username: root
key:
from_secret: cd_ssh_key
port: 22
command_timeout: 2m
script:
- systemctl restart docker-compose@hatecomputers-club
trigger: trigger:
branch: branch:

View File

@ -10,7 +10,7 @@ import (
func StartScheduler(dbConn *sql.DB) { func StartScheduler(dbConn *sql.DB) {
scheduler := gocron.NewScheduler(time.Local) scheduler := gocron.NewScheduler(time.Local)
scheduler.Every(1).Minute().Do(func() { scheduler.Every(1).Hour().Do(func() {
database.DeleteOldBackups(dbConn, 31) database.DeleteOldBackups(dbConn, 31)
}) })
scheduler.StartAsync() scheduler.StartAsync()