Skip to content

Commit

Permalink
scale to zero in machine app
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho committed Apr 17, 2023
1 parent 96b55cf commit 9825986
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func main() {
for {
time.Sleep(1 * time.Minute) // Check every minute
if time.Since(lastRequest) > duration {
fmt.Println("No activity for 30 minutes. Exiting.")
fmt.Printf("No activity for %s. Exiting.", restartInterval)
os.Exit(0)
return
}
Expand Down
5 changes: 3 additions & 2 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# fly.toml file generated for swuecho-chat on 2023-04-15T12:26:26+08:00
# create machines type app, so scale to zero worker
# fly apps create --machines --name swuecho-chat-m

app = "swuecho-chat" # change this to your app name
app = "swuecho-chat-m" # change this to your app name
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "dfw" # change this to your region
Expand Down

0 comments on commit 9825986

Please sign in to comment.