Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It was the cronserver mgmt command all along #3152

Merged
merged 5 commits into from
Mar 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions kalitectl.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
from socket import timeout
from kalite.version import VERSION

if os.name == "nt":
from subprocess import Popen, CREATE_NEW_PROCESS_GROUP

# Necessary for loading default settings from kalite
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kalite.settings")

Expand Down Expand Up @@ -219,7 +222,7 @@ def get_pid():
listen_port = getattr(settings, "CHERRYPY_PORT", LISTEN_PORT)

# Timeout is 1 second, we don't want the status command to be slow
conn = httplib.HTTPConnection(LISTEN_ADDRESS, listen_port, timeout=3)
conn = httplib.HTTPConnection("127.0.0.1", listen_port, timeout=3)

This comment was marked as spam.

This comment was marked as spam.

try:
conn.request("GET", PING_URL)
response = conn.getresponse()
Expand Down Expand Up @@ -290,8 +293,12 @@ def manage(command, args=[], in_background=False):
utility.prog_name = 'kalite manage'
utility.execute()
else:
thread = ManageThread(command, args=args)
thread.start()
if os.name != "nt":
thread = ManageThread(command, args=args, name=" ".join([command]+args))
thread.start()
else:
# TODO (aron): for versions > 0.13, see if we can just have everyone spawn another process (Popen vs. ManageThread)
Popen([sys.executable, os.path.abspath(sys.argv[0]), "manage", command] + args, creationflags=CREATE_NEW_PROCESS_GROUP)

This comment was marked as spam.

This comment was marked as spam.



def start(debug=False, args=[], skip_job_scheduler=False):
Expand Down