this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "Make CAR parsing optional"

This reverts commit feed3507f791b938e8631cf086f9116d793aad9f.

+4 -6
+1 -1
bsky-activity.py
··· 45 45 sys.stdout.flush() 46 46 47 47 op_count = 0 48 - for commit, op in subscribe_commits(redis_cnx, parse_car_blocks=False): 48 + for commit, op in subscribe_commits(redis_cnx): 49 49 if op['action'] != 'create': 50 50 continue 51 51
+3 -5
firehose_utils.py
··· 3 3 from atproto import CAR 4 4 from io import BytesIO 5 5 6 - def subscribe_commits(redis_cnx=None, parse_car_blocks=False): 6 + def subscribe_commits(redis_cnx=None): 7 7 if redis_cnx is None: 8 8 redis_cnx = redis.Redis() 9 9 redis_sub = redis_cnx.pubsub(ignore_subscribe_messages=True) ··· 22 22 23 23 # TODO(ejd): figure out how to validate blocks 24 24 blocks = payload.pop('blocks') 25 - if parse_car_blocks: 26 - car_parsed = CAR.from_bytes(blocks) 25 + car_parsed = CAR.from_bytes(blocks) 27 26 28 27 message = payload.copy() 29 28 del message['ops'] ··· 33 32 op = commit_op.copy() 34 33 if op['cid'] is not None: 35 34 op['cid'] = op['cid'].encode('base32') 36 - if parse_car_blocks: 37 - op['record'] = car_parsed.blocks[op['cid']] 35 + op['record'] = car_parsed.blocks[op['cid']] 38 36 yield message, op