Properly process Redis buffered messages and ingest into Kafka

This commit is contained in:
2022-09-14 18:32:32 +01:00
parent fec0d379a6
commit 4ea77ac543
6 changed files with 190 additions and 133 deletions

View File

@@ -136,7 +136,7 @@ class Chan4(object):
# Split into 10,000 chunks
if not all_posts:
return
self.handle_posts(all_posts)
await self.handle_posts(all_posts)
# threads_per_core = int(len(all_posts) / CPU_THREADS)
# for i in range(CPU_THREADS):
# new_dict = {}
@@ -146,8 +146,7 @@ class Chan4(object):
# new_dict[k].append(v)
# else:
# new_dict[k] = [v]
#await self.handle_posts_thread(new_dict)
# await self.handle_posts_thread(new_dict)
# print("VAL", ceil(len(all_posts) / threads_per_core))
# split_posts = array_split(all_posts, ceil(len(all_posts) / threads_per_core))