kopia lustrzana https://github.com/snarfed/bridgy-fed
ATProto: tweak polling: every 5 min, 10 items each call
rodzic
0238b46e36
commit
4efb0d3e35
|
@ -594,7 +594,7 @@ def poll_notifications():
|
|||
client.session['accessJwt'] = service_jwt(os.environ['APPVIEW_HOST'],
|
||||
repo_did=did,
|
||||
privkey=repo.signing_key)
|
||||
resp = client.app.bsky.notification.listNotifications()
|
||||
resp = client.app.bsky.notification.listNotifications(limit=10)
|
||||
for notif in resp['notifications']:
|
||||
actor_did = notif['author']['did']
|
||||
logger.debug(f'Got {notif["reason"]} from {notif["author"]["handle"]} {notif["uri"]} {notif["cid"]} : {json_dumps(notif, indent=2)}')
|
||||
|
@ -653,7 +653,7 @@ def poll_posts():
|
|||
client.session['accessJwt'] = service_jwt(os.environ['APPVIEW_HOST'],
|
||||
repo_did=did,
|
||||
privkey=repo.signing_key)
|
||||
resp = client.app.bsky.feed.getTimeline()
|
||||
resp = client.app.bsky.feed.getTimeline(limit=10)
|
||||
for item in resp['feed']:
|
||||
# TODO: handle reposts once we have a URI for them
|
||||
# https://github.com/bluesky-social/atproto/issues/1811
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
cron:
|
||||
- description: ATProto poll posts
|
||||
url: /queue/atproto-poll-posts
|
||||
schedule: every 15 minutes
|
||||
schedule: every 5 minutes
|
||||
target: hub
|
||||
|
||||
- description: ATProto poll notifications
|
||||
url: /queue/atproto-poll-notifs
|
||||
schedule: every 15 minutes
|
||||
schedule: every 5 minutes
|
||||
target: hub
|
||||
|
|
|
@ -1192,7 +1192,7 @@ class ATProtoTest(TestCase):
|
|||
self.assertEqual(200, resp.status_code)
|
||||
|
||||
expected_list_notifs = call(
|
||||
'https://api.bsky-sandbox.dev/xrpc/app.bsky.notification.listNotifications',
|
||||
'https://api.bsky-sandbox.dev/xrpc/app.bsky.notification.listNotifications?limit=10',
|
||||
json=None, data=None,
|
||||
headers={
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -1290,7 +1290,7 @@ class ATProtoTest(TestCase):
|
|||
self.assertEqual(200, resp.status_code)
|
||||
|
||||
get_timeline = call(
|
||||
'https://api.bsky-sandbox.dev/xrpc/app.bsky.feed.getTimeline',
|
||||
'https://api.bsky-sandbox.dev/xrpc/app.bsky.feed.getTimeline?limit=10',
|
||||
json=None, data=None,
|
||||
headers={
|
||||
'Content-Type': 'application/json',
|
||||
|
|
Ładowanie…
Reference in New Issue