-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaced system subcommand with global run subcommand
- Loading branch information
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ | |
from . import cache | ||
from . import util | ||
from . import web | ||
from .run import run | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding=utf-8 -*- | ||
r""" | ||
""" | ||
|
||
|
||
def run(): | ||
import time | ||
import multiprocessing | ||
from ..web import run as web_run | ||
from ..cache import run as cache_run | ||
|
||
web = multiprocessing.Process(target=web_run, name="web") | ||
cache = multiprocessing.Process(target=cache_run, name="cache") | ||
|
||
web.start() | ||
cache.start() | ||
|
||
try: | ||
while web.is_alive() and cache.is_alive(): | ||
time.sleep(1) | ||
except KeyboardInterrupt: | ||
if web.is_alive(): | ||
web.terminate() | ||
if cache.is_alive(): | ||
cache.terminate() | ||
web.join(timeout=10) | ||
cache.join(timeout=10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters