Skip to content

Commit

Permalink
dix: update deps
Browse files Browse the repository at this point in the history
Signed-off-by: WoodenMaiden <[email protected]>
  • Loading branch information
WoodenMaiden committed May 13, 2024
1 parent 9f5f0eb commit a584da1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ require (
github.com/caarlos0/env/v10 v10.0.0
github.com/gin-gonic/gin v1.9.1
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/uuid v1.6.0
github.com/joho/godotenv v1.5.1
github.com/minio/minio-go/v7 v7.0.69
github.com/google/uuid v1.6.0
gorm.io/gorm v1.25.8
)

require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/caarlos0/env/v10 v10.0.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect
Expand All @@ -43,7 +41,6 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/google/uuid v1.6.0
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down
20 changes: 10 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

type Config struct {
// rootFsStorageDSN string `env:"ROOT_FS_STORAGE_DSN,notEmpty"`
VMStateURL string `env:"VM_STATE_URL,notEmpty"`
VMStateURL string `env:"VM_STATE_URL,notEmpty"`
FuntionStateStorageDSN string `env:"FUNCTION_STATE_STORAGE_DSN,notEmpty" envDefault:"host=localhost user=postgres password=postgres dbname=postgres port=5432 sslmode=disable TimeZone=Asia/Shanghai"`
JWTSecret string `env:"JWT_SECRET,notEmpty"`
BuilderEndpoint string `env:"BUILDER_ENDPOINT,notEmpty"`
Expand All @@ -39,19 +39,19 @@ func main() {
redis := database.InitRedis(cfg.VMStateURL)

s := &scheduler.Scheduler{
Redis: redis,
Redis: redis,
Context: &ctx,
}
//Now inject the scheduler into the routes that need it!
//Now inject the scheduler into the routes that need it!

go func() {
// every 24 hours we check for
for {
time.Sleep(time.Hour * 6)

go func() {
// every 24 hours we check for
for {
time.Sleep(time.Hour * 6);

log.Println("Ran instance pruning at", time.Now().UTC())
s.FindAndDestroyUnsused(24);
}
s.FindAndDestroyUnsused(24)
}
}()

db := database.Init(cfg.FuntionStateStorageDSN)
Expand Down

0 comments on commit a584da1

Please sign in to comment.