prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [BUG] Increase worker-timeout to account for install times
   I might have another instance of the same worker-timeout-loop during startup to add to the issue. My docker production installation at InvenTree:latest is running on a Raspberry Pi 3B+.
  The loop occured after I had added the `inventree-brother-plugin` to `plugins.txt` - the initial plugin installation took too long during startup so that the worker processes timed out and were constantly restartet.
  
  My "solution" was to increase the gunicorn timeout variable in the `.env` file to
  ```
  # Options for gunicorn server
  INVENTREE_GUNICORN_TIMEOUT=60
  ```
  but maybe actions like pip installs should somehow generally not count against the worker timeout? (I'm not sure about the technical internals on this one at the moment...)
  
  _Originally posted by @simonkuehling in https://github.com/inventree/InvenTree/issues/4180#issuecomment-1410348943_
              
  
  </issue>
  <code>
  [start of docker/gunicorn.conf.py]
  1 """Gunicorn configuration for InvenTree."""
  2 
  3 import logging
  4 import multiprocessing
  5 import os
  6 
  7 # Logger configuration
  8 logger = logging.getLogger('inventree')
  9 accesslog = '-'
  10 errorlog = '-'
  11 loglevel = os.environ.get('INVENTREE_LOG_LEVEL', 'warning').lower()
  12 capture_output = True
  13 
  14 # Worker configuration
  15 #  TODO: Implement support for gevent
  16 # worker_class = 'gevent'  # Allow multi-threading support
  17 worker_tmp_dir = '/dev/shm'  # Write temp file to RAM (faster)
  18 threads = 4
  19 
  20 
  21 # Worker timeout (default = 30 seconds)
  22 timeout = os.environ.get('INVENTREE_GUNICORN_TIMEOUT', 30)
  23 
  24 # Number of worker processes
  25 workers = os.environ.get('INVENTREE_GUNICORN_WORKERS', None)
  26 
  27 if workers is not None:
  28     try:
  29         workers = int(workers)
  30     except ValueError:
  31         workers = None
  32 
  33 if workers is None:
  34     workers = multiprocessing.cpu_count() * 2 + 1
  35 
  36 logger.info(f"Starting gunicorn server with {workers} workers")
  37 
  38 max_requests = 1000
  39 max_requests_jitter = 50
  40
  [end of docker/gunicorn.conf.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/docker/gunicorn.conf.py b/docker/gunicorn.conf.py
  --- a/docker/gunicorn.conf.py
  +++ b/docker/gunicorn.conf.py
  @@ -18,8 +18,8 @@
   threads = 4
   
   
  -# Worker timeout (default = 30 seconds)
  -timeout = os.environ.get('INVENTREE_GUNICORN_TIMEOUT', 30)
  +# Worker timeout (default = 90 seconds)
  +timeout = os.environ.get('INVENTREE_GUNICORN_TIMEOUT', 90)
   
   # Number of worker processes
   workers = os.environ.get('INVENTREE_GUNICORN_WORKERS', None)
  
verification_info: {"golden_diff": "diff --git a/docker/gunicorn.conf.py b/docker/gunicorn.conf.py\n--- a/docker/gunicorn.conf.py\n+++ b/docker/gunicorn.conf.py\n@@ -18,8 +18,8 @@\n threads = 4\n \n \n-# Worker timeout (default = 30 seconds)\n-timeout = os.environ.get('INVENTREE_GUNICORN_TIMEOUT', 30)\n+# Worker timeout (default = 90 seconds)\n+timeout = os.environ.get('INVENTREE_GUNICORN_TIMEOUT', 90)\n \n # Number of worker processes\n workers = os.environ.get('INVENTREE_GUNICORN_WORKERS', None)\n", "issue": "[BUG] Increase worker-timeout to account for install times\n I might have another instance of the same worker-timeout-loop during startup to add to the issue. My docker production installation at InvenTree:latest is running on a Raspberry Pi 3B+.\r\nThe loop occured after I had added the `inventree-brother-plugin` to `plugins.txt` - the initial plugin installation took too long during startup so that the worker processes timed out and were constantly restartet.\r\n\r\nMy \"solution\" was to increase the gunicorn timeout variable in the `.env` file to\r\n```\r\n# Options for gunicorn server\r\nINVENTREE_GUNICORN_TIMEOUT=60\r\n```\r\nbut maybe actions like pip installs should somehow generally not count against the worker timeout? (I'm not sure about the technical internals on this one at the moment...)\r\n\r\n_Originally posted by @simonkuehling in https://github.com/inventree/InvenTree/issues/4180#issuecomment-1410348943_\r\n            \n", "before_files": [{"content": "\"\"\"Gunicorn configuration for InvenTree.\"\"\"\n\nimport logging\nimport multiprocessing\nimport os\n\n# Logger configuration\nlogger = logging.getLogger('inventree')\naccesslog = '-'\nerrorlog = '-'\nloglevel = os.environ.get('INVENTREE_LOG_LEVEL', 'warning').lower()\ncapture_output = True\n\n# Worker configuration\n#  TODO: Implement support for gevent\n# worker_class = 'gevent'  # Allow multi-threading support\nworker_tmp_dir = '/dev/shm'  # Write temp file to RAM (faster)\nthreads = 4\n\n\n# Worker timeout (default = 30 seconds)\ntimeout = os.environ.get('INVENTREE_GUNICORN_TIMEOUT', 30)\n\n# Number of worker processes\nworkers = os.environ.get('INVENTREE_GUNICORN_WORKERS', None)\n\nif workers is not None:\n    try:\n        workers = int(workers)\n    except ValueError:\n        workers = None\n\nif workers is None:\n    workers = multiprocessing.cpu_count() * 2 + 1\n\nlogger.info(f\"Starting gunicorn server with {workers} workers\")\n\nmax_requests = 1000\nmax_requests_jitter = 50\n", "path": "docker/gunicorn.conf.py"}]}