Getting timeout with my python script

Hi there,

I was able to deploy it, but my app seems to be restarting a lot.

My logs:

My fly.toml file

# fly.toml file generated for cupom-husky on 2023-02-12T15:46:06-03:00

app = "cupom-husky"
kill_signal = "SIGINT"
kill_timeout = 300
processes = []

[build]
  builder = "paketobuildpacks/builder:base"

[env]
  PORT = "8080"

[experimental]
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

My Procfile:

web: gunicorn bot_telegram:app

I have tried different approaches, such as changing Procfile to Worker instead of Web, and also server instead of app, but still getting the same problem.

On my machine, it runs for a long time without timeouts.

Thanks.

I figured out how to solve that, in case someone got the same problem.

In the fly.toml I added:

[processes]
worker = "python myscript.py"

I also changed the Procfile, but it didn’t seems to make any difference:

worker: gunicorn bot_telegram:app

I find that on this link about rails workers: