revert to use a separate executable for gevent, add --dev option
bzr revid: al@openerp.com-20130909200825-sm5c3invmg7tt70j
This commit is contained in:
parent
f8c0310d8e
commit
2a6d0299d9
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import gevent.monkey
|
||||
gevent.monkey.patch_all()
|
||||
import psycogreen.gevent
|
||||
psycogreen.gevent.patch_psycopg()
|
||||
|
||||
import openerp
|
||||
|
||||
openerp.evented = True
|
||||
|
||||
if __name__ == "__main__":
|
||||
openerp.cli.main()
|
|
@ -27,16 +27,6 @@ import sys
|
|||
|
||||
# Is the server running with gevent.
|
||||
evented = False
|
||||
for i in sys.argv:
|
||||
if i.startswith('--gevent'):
|
||||
evented = True
|
||||
break
|
||||
|
||||
if evented:
|
||||
import gevent.monkey
|
||||
gevent.monkey.patch_all()
|
||||
import psycogreen.gevent
|
||||
psycogreen.gevent.patch_psycopg()
|
||||
|
||||
# Make sure the OpenERP server runs in UTC. This is especially necessary
|
||||
# under Windows as under Linux it seems the real import of time is
|
||||
|
|
|
@ -326,7 +326,9 @@ class Multicorn(CommonServer):
|
|||
|
||||
def long_polling_spawn(self):
|
||||
nargs = stripped_sys_argv('--pidfile','--workers')
|
||||
nargs += ['--gevent']
|
||||
cmd = nargs[0]
|
||||
cmd = os.path.join(os.path.dirname(cmd), "openerp-gevent")
|
||||
nargs[0] = cmd
|
||||
popen = subprocess.Popen(nargs)
|
||||
self.long_polling_pid = popen.pid
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ class configmanager(object):
|
|||
help="specify additional addons paths (separated by commas).",
|
||||
action="callback", callback=self._check_addons_path, nargs=1, type="string")
|
||||
group.add_option("--load", dest="server_wide_modules", help="Comma-separated list of server-wide modules default=web")
|
||||
group.add_option("--gevent", dest="gevent", action="store_true", my_default=False, help="Activate the GEvent mode, this also desactivate the cron.")
|
||||
group.add_option("--dev", dest="dev", action="store_true", my_default=False, help="Activate the developer mode. (code and views auto-reload).")
|
||||
parser.add_option_group(group)
|
||||
|
||||
# XML-RPC / HTTP
|
||||
|
@ -399,7 +399,7 @@ class configmanager(object):
|
|||
'list_db', 'xmlrpcs', 'proxy_mode',
|
||||
'test_file', 'test_enable', 'test_commit', 'test_report_directory',
|
||||
'osv_memory_count_limit', 'osv_memory_age_limit', 'max_cron_threads', 'unaccent',
|
||||
'workers', 'limit_memory_hard', 'limit_memory_soft', 'limit_time_cpu', 'limit_time_real', 'limit_request', 'gevent'
|
||||
'workers', 'limit_memory_hard', 'limit_memory_soft', 'limit_time_cpu', 'limit_time_real', 'limit_request', 'dev'
|
||||
]
|
||||
|
||||
for arg in keys:
|
||||
|
|
Loading…
Reference in New Issue