Merge branch 'master' of github.com:kylewm/woodwind
This commit is contained in:
commit
9ec34de4fc
5 changed files with 15 additions and 14 deletions
1
fabfile.py
vendored
1
fabfile.py
vendored
|
@ -32,7 +32,6 @@ def restart():
|
|||
with prefix("source venv/bin/activate"):
|
||||
run("pip install --upgrade -r requirements.txt")
|
||||
sudo("restart woodwind")
|
||||
sudo("restart woodwind-celery")
|
||||
sudo("restart woodwind-tornado")
|
||||
|
||||
|
||||
|
|
7
timers.py
Normal file
7
timers.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
from uwsgidecorators import timer
|
||||
from woodwind import tasks
|
||||
|
||||
|
||||
@timer(300)
|
||||
def tick(signum=None):
|
||||
tasks.q.enqueue(tasks.tick)
|
|
@ -5,5 +5,5 @@ threads=4
|
|||
socket=/tmp/woodwind.sock
|
||||
chmod-socket=666
|
||||
module=woodwind.wsgi
|
||||
attach-daemon=rqworker
|
||||
import=woodwind.tasks
|
||||
import=timers
|
||||
attach-daemon=venv/bin/rqworker
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from config import Config
|
||||
from contextlib import contextmanager
|
||||
from redis import StrictRedis
|
||||
from uwsgidecorators import timer
|
||||
from woodwind.models import Feed, Entry
|
||||
import bs4
|
||||
import datetime
|
||||
|
@ -45,8 +44,7 @@ def session_scope():
|
|||
session.close()
|
||||
|
||||
|
||||
@timer(300)
|
||||
def tick(signum=None):
|
||||
def tick():
|
||||
"""Checks all feeds to see if any of them are ready for an update.
|
||||
Makes use of uWSGI timers to run every 5 minutes, without needing
|
||||
a separate process to fire ticks.
|
||||
|
|
|
@ -46,17 +46,14 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if entry._syndicated_copies %}
|
||||
<div>
|
||||
Also on
|
||||
{% for copy in entry._syndicated_copies %}
|
||||
{{ copy.permalink | domain_for_url }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<footer>
|
||||
<a href="{{ entry.permalink }}">{{ entry.published | relative_time }}</a>
|
||||
|
||||
{% if entry._syndicated_copies %}
|
||||
(also on{% for copy in entry._syndicated_copies %} <a href="{{ copy.permalink }}">{{ copy.permalink | domain_for_url }}</a>{% endfor %})
|
||||
{% endif %}
|
||||
|
||||
<div class="reply-area">
|
||||
{% include '_reply.jinja2' with context %}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue