mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
some fixes to config and pidfile
This commit is contained in:
parent
7280ad20f8
commit
f75a413773
@ -12,7 +12,7 @@ from gunicorn import util
|
|||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
|
|
||||||
DEFAULT_CONFIG_FILE = 'gunicorn.conf.py',
|
DEFAULT_CONFIG_FILE = 'gunicorn.conf.py'
|
||||||
|
|
||||||
DEFAULTS = dict(
|
DEFAULTS = dict(
|
||||||
backlog=2048,
|
backlog=2048,
|
||||||
@ -42,7 +42,7 @@ class Config(object):
|
|||||||
def __init__(self, cmdopts, path=None):
|
def __init__(self, cmdopts, path=None):
|
||||||
if not path:
|
if not path:
|
||||||
self.config_file = os.path.join(os.getcwd(),
|
self.config_file = os.path.join(os.getcwd(),
|
||||||
self.DEFAULT_CONFIG_FILE)
|
self.DEFAULT_CONFIG_FILE)
|
||||||
else:
|
else:
|
||||||
self.config_file = os.path.abspath(os.path.normpath(path))
|
self.config_file = os.path.abspath(os.path.normpath(path))
|
||||||
self.cmdopts = cmdopts
|
self.cmdopts = cmdopts
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
# This file is part of gunicorn released under the MIT license.
|
# This file is part of gunicorn released under the MIT license.
|
||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
|
import errno
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ class Pidfile(object):
|
|||||||
return path
|
return path
|
||||||
raise RuntimeError("Already running on PID %s " \
|
raise RuntimeError("Already running on PID %s " \
|
||||||
"(or pid file '%s' is stale)" % (os.getpid(), path))
|
"(or pid file '%s' is stale)" % (os.getpid(), path))
|
||||||
if instane._pidfile:
|
if instance._pidfile:
|
||||||
self.unlink_pidfile(instance, instance._pidfile)
|
self.unlink_pidfile(instance, instance._pidfile)
|
||||||
|
|
||||||
# write pidfile
|
# write pidfile
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user