Skip to content

Commit

Permalink
ban running with multiple processes
Browse files Browse the repository at this point in the history
site and app.config['USERS'] change on runtime.  If more than
one processes is created, many requests will fail if changes
do occur.

We may find a fix in the future.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 11, 2015
1 parent dcea899 commit 8d3117b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 0 additions & 2 deletions comet/web.py
Expand Up @@ -270,7 +270,6 @@ def find_post(path):
:return: A post matching the path
:rtype: Post or None
"""
scan_site()
for p in site.timeline:
if p.source_path == path:
return p
Expand Down Expand Up @@ -458,7 +457,6 @@ def index():
:param int all: Whether or not should show all posts
"""
scan_site()
if not os.path.exists(os.path.join(site.config["OUTPUT_FOLDER"],
'assets')):
return redirect('/setup')
Expand Down
23 changes: 19 additions & 4 deletions docs/admin/setup.rst
Expand Up @@ -95,14 +95,18 @@ Permissions
Chown ``my_comet_site`` *recursively* to ``nobody``, or whatever
user Comet will run as. Comet must be able to write to this directory.

Server: uWSGI and nginx
=======================
Server
======

For testing purposes, you can use ``comet devserver``. It should **NOT** be used
in production. You should use uWSGI Emperor and nginx in a real environment.

uWSGI
-----

Sample uWSGI configuration:


.. code-block:: ini
[uwsgi]
Expand All @@ -118,11 +122,22 @@ Sample uWSGI configuration:
plugins = python2
uid = nobody
gid = nobody
processes = 3
processes = 1
logger = file:/var/comet/my_comet_site/uwsgi.log
.. note::

``python2`` may also be ``python`` this depending on your environment.

.. danger::

Comet **CANNOT** be run with more than one ``process``. Otherwise, bad
things will happen as Comet changes some things during the runtime.
Supporting multiple processes would require reloading files from the
filesystem on *every request*.

(``python2`` may also be ``python``, this depends on your environment)
nginx
-----

Sample nginx configuration:

Expand Down

0 comments on commit 8d3117b

Please sign in to comment.