Skip to content

Commit

Permalink
Increase the limit of conflict checking of generate-input subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
kmyk committed Oct 22, 2020
1 parent a324882 commit 418852f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion onlinejudge_command/subcommand/generate_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def check_randomness_of_generator(input_data: bytes, *, name: str, lock: Optiona
"""

# To prevent consuming unlimited memories, do nothing if the user's generator is properly implemented.
limit = 100
limit = 1000
if len(generated_input_hashes) >= limit:
return None

Expand All @@ -94,6 +94,8 @@ def check_randomness_of_generator(input_data: bytes, *, name: str, lock: Optiona
return generated_input_hashes[input_digest]
else:
generated_input_hashes[input_digest] = name
if len(generated_input_hashes) == limit:
logger.info('Conflict checking of generated inputs is disabled now because it seems the given input generator has enough randomness.') # This prints a log line but it's safe because here is in a lock.
return None


Expand Down

0 comments on commit 418852f

Please sign in to comment.