Skip to content

Commit

Permalink
Merge pull request #107
Browse files Browse the repository at this point in the history
Logmatch : Resolve matching with n_workers greater than 1
  • Loading branch information
zhujiem authored Jan 9, 2024
2 parents 32d0c14 + 825e7a7 commit 097ac7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logparser/logmatch/regexmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def match_event(self, event_list):
results = match_fn(event_list, self.template_match_dict, self.optimized)
else:
pool = mp.Pool(processes=self.n_workers)
chunk_size = len(event_list) / self.n_workers + 1
chunk_size = len(event_list) // self.n_workers + 1
result_chunks = [
pool.apply_async(
match_fn,
Expand All @@ -86,7 +86,7 @@ def match_event(self, event_list):
self.optimized,
),
)
for i in xrange(0, len(event_list), chunk_size)
for i in range(0, len(event_list), chunk_size)
]
pool.close()
pool.join()
Expand Down

0 comments on commit 097ac7f

Please sign in to comment.