tangled
alpha
login
or
join now
edavis.dev
/
bsky-tools
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
feat: print timestamp
Eric Davis
1 year ago
4700b44d
9de95d3d
+1
-6
1 changed file
expand all
collapse all
unified
split
bsky-activity.py
+1
-6
bsky-activity.py
···
75
if collection.startswith(prefix):
76
redis_pipe.incr('dev.edavis.atproto.collection.' + prefix.replace('.', '_'))
77
78
-
repo_did = event['did']
79
-
repo_update_time = datetime.now(timezone.utc)
80
-
81
if collection == 'app.bsky.feed.post':
82
embed = payload['record'].get('embed')
83
if embed is not None and embed.get('$type', ''):
···
90
91
op_count += 1
92
if op_count % 500 == 0:
93
-
current_time_ms = datetime.now(timezone.utc).timestamp()
94
event_time_ms = event['time_us'] / 1_000_000
95
-
current_lag = current_time_ms - event_time_ms
96
-
sys.stdout.write(f'lag: {current_lag:.2f}\n')
97
redis_pipe.execute()
98
sys.stdout.flush()
99
···
75
if collection.startswith(prefix):
76
redis_pipe.incr('dev.edavis.atproto.collection.' + prefix.replace('.', '_'))
77
0
0
0
78
if collection == 'app.bsky.feed.post':
79
embed = payload['record'].get('embed')
80
if embed is not None and embed.get('$type', ''):
···
87
88
op_count += 1
89
if op_count % 500 == 0:
0
90
event_time_ms = event['time_us'] / 1_000_000
91
+
sys.stdout.write(f'timestamp: {event_time_ms}\n')
0
92
redis_pipe.execute()
93
sys.stdout.flush()
94