fetch reply contexts only after saving the original set of entries
This commit is contained in:
parent
db006d58d6
commit
17da903db7
3 changed files with 9 additions and 7 deletions
|
@ -72,8 +72,10 @@ $(function(){
|
|||
function webSocketSubscribe(topic) {
|
||||
if ('WebSocket' in window) {
|
||||
var ws = new WebSocket(window.location.origin
|
||||
.replace(/https?:\/\//, 'ws://')
|
||||
.replace(/(:\d+)?$/, ':8077'));
|
||||
.replace(/http:\/\//, 'ws://')
|
||||
.replace(/https:\/\//, 'wss://')
|
||||
+ '/_updates');
|
||||
|
||||
ws.onopen = function(event) {
|
||||
// send the topic
|
||||
console.log('subscribing to topic: ' + topic);
|
||||
|
|
|
@ -109,14 +109,14 @@ def process_feed(session, feed):
|
|||
|
||||
feed.entries.append(entry)
|
||||
session.commit()
|
||||
|
||||
for in_reply_to in entry.get_property('in-reply-to', []):
|
||||
fetch_reply_context(entry.id, in_reply_to)
|
||||
|
||||
new_entries.append(entry)
|
||||
else:
|
||||
logger.info('skipping previously seen post %s', old.permalink)
|
||||
|
||||
for entry in new_entries:
|
||||
for in_reply_to in entry.get_property('in-reply-to', []):
|
||||
fetch_reply_context(entry.id, in_reply_to)
|
||||
|
||||
finally:
|
||||
feed.last_checked = now
|
||||
if new_entries:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% if ws_topic %}
|
||||
<script>var WS_TOPIC = "{{ ws_topic }}";</script>
|
||||
{% endif %}
|
||||
<script src="{{url_for('static', filename='feed.js', version='2015-02-24')}}"></script>
|
||||
<script src="{{url_for('static', filename='feed.js', version='2015-03-16')}}"></script>
|
||||
|
||||
{% if current_user and current_user.settings
|
||||
and current_user.settings.get('reply-method') == 'indie-config' %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue