do not use Flask-SQLAlchemy from async tasks
This commit is contained in:
parent
56b1485d21
commit
67c617e9dc
2 changed files with 2 additions and 1 deletions
|
@ -114,7 +114,6 @@ class Feed(db.Model):
|
||||||
def get_or_create_push_secret(self):
|
def get_or_create_push_secret(self):
|
||||||
if not self.push_secret:
|
if not self.push_secret:
|
||||||
self.push_secret = uuid.uuid4().hex
|
self.push_secret = uuid.uuid4().hex
|
||||||
db.commit()
|
|
||||||
return self.push_secret
|
return self.push_secret
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|
|
@ -210,6 +210,8 @@ def check_push_subscription(session, feed, response):
|
||||||
if hub and topic:
|
if hub and topic:
|
||||||
send_request('subscribe', hub, topic)
|
send_request('subscribe', hub, topic)
|
||||||
|
|
||||||
|
session.commit()
|
||||||
|
|
||||||
|
|
||||||
def notify_feed_updated(session, feed, entries):
|
def notify_feed_updated(session, feed, entries):
|
||||||
"""Render the new entries and publish them to redis
|
"""Render the new entries and publish them to redis
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue