counter_file

get_and_increment_counter(counter_file_path: str) int[source]

A function that gets and increments a counter stored in a file. Problems will arise if multiple processes try to access the file at the same time.

Parameters:

counter_file_path (str) – Path to the file where the counter is stored.

Returns:

The value of the counter after incrementation.

Return type:

int