Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions cmd/cleanupdaemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,21 @@ func main() {
})

daemon := daemon.NewDaemon(logger, conf, client, db)

// sentry-go buffers on an async transport; ONESHOT would otherwise drop the
// final run's events on return.
defer sentry.Flush(time.Second * 2)
defer logger.Sync()
defer pool.Close()

daemon.Run()

if !conf.OneShot {
for {
time.Sleep(time.Hour * 6)
daemon.Run()
}
if conf.OneShot {
return
}

for {
time.Sleep(time.Hour * 6)
daemon.Run()
}
}
48 changes: 24 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
module github.com/TicketsBot-cloud/cleanupdaemon

go 1.24.0
go 1.26.0

//replace github.com/TicketsBot-cloud/archiverclient => ../archiverclient
// replace github.com/TicketsBot-cloud/archiverclient => ../archiverclient

//replace github.com/TicketsBot-cloud/common => ../common
// replace github.com/TicketsBot-cloud/common => ../common

//replace github.com/TicketsBot-cloud/database => ../database
// replace github.com/TicketsBot-cloud/database => ../database

require (
github.com/TicketsBot-cloud/archiverclient v0.0.0-20260106203614-3f2fdd061b8b
github.com/TicketsBot-cloud/common v0.0.0-20251026182733-99fa0dc31d90
github.com/TicketsBot-cloud/database v0.0.0-20260106203748-e9a3db5cdcd6
github.com/TicketsBot-cloud/archiverclient v0.0.0-20260912070140-b0cd1b003b87
github.com/TicketsBot-cloud/common v0.0.0-20260905165836-38e4090764a4
github.com/TicketsBot-cloud/database v0.0.0-20260913165941-c2ecc7191b02
github.com/caarlos0/env/v6 v6.10.1
github.com/getsentry/sentry-go v0.40.0
github.com/jackc/pgx/v4 v4.18.3
github.com/rxdn/gdl v0.0.0-20250908075949-f41d48a635f2
go.uber.org/zap v1.27.1
go.uber.org/zap v1.28.0
)

require (
github.com/TicketsBot-cloud/gdl v0.0.0-20260103195545-cf76b185bdbc // indirect
github.com/TicketsBot-cloud/logarchiver v0.0.0-20251018211319-7a7df5cacbdc // indirect
github.com/TicketsBot-cloud/gdl v0.0.0-20260612070331-a3947b410d3e // indirect
github.com/TicketsBot-cloud/logarchiver v0.0.0-20260909063657-e32e33f1289b // indirect
github.com/TicketsBot/common v0.0.0-20241117150316-ff54c97b45c1 // indirect
github.com/TicketsBot/ttlcache v1.6.1-0.20200405150101-acc18e37b261 // indirect
github.com/caarlos0/env v3.5.0+incompatible // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
Expand All @@ -40,32 +38,34 @@ require (
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgtype v1.14.4 // indirect
github.com/jackc/pgx v3.6.2+incompatible // indirect
github.com/jackc/pgx/v5 v5.8.0 // indirect
github.com/jackc/pgx/v5 v5.11.0 // indirect
github.com/jackc/puddle v1.3.0 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/juju/ratelimit v1.0.2 // indirect
github.com/klauspost/compress v1.18.2 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/klauspost/compress v1.20.0 // indirect
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
github.com/klauspost/crc32 v1.3.0 // indirect
github.com/minio/crc64nvme v1.1.1 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/minio-go/v7 v7.0.97 // indirect
github.com/minio/minio-go/v7 v7.3.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/onsi/gomega v1.27.1 // indirect
github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c // indirect
github.com/philhofer/fwd v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tinylib/msgp v1.6.3 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/tinylib/msgp v1.6.4 // indirect
github.com/zeebo/xxh3 v1.1.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.46.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/crypto v0.57.0 // indirect
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
golang.org/x/net v0.59.0 // indirect
golang.org/x/sync v0.23.0 // indirect
golang.org/x/sys v0.48.0 // indirect
golang.org/x/text v0.42.0 // indirect
gopkg.in/ini.v1 v1.67.3 // indirect
)
Loading
Loading