Commit f459dabb authored by juga's avatar juga
Browse files

Move started_filepath conf option to paths

parent be01874b
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
[paths]
datadir = ${sbws_home}/datadir
v3bw_fname = ${sbws_home}/v3bw.txt
started_filepath = {sbws_home}/started_at
started_filepath = ${sbws_home}/started_at

[destinations]
# The path part of the URL for a destination if not specified. For example,
@@ -46,11 +46,22 @@ num_downloads = 5
initial_read_request = 16384
# How many measurements to make in parallel
measurement_threads = 3
<<<<<<< HEAD
# Minimum number of bytes we should ever try to download in a measurement
min_download_size = 1
# Maximum number of bytes we should ever try to download in a measurement
# 1073741824 == 1 GiB
max_download_size = 1073741824
=======
# Whether or not to measure authorities
measure_authorities = off

[server]
bind_ip = 127.0.0.1
bind_port = 31648
# Maximum number of bytes to write for each sock.send() call
max_send_per_write = 4096
>>>>>>> Move started_filepath conf option to paths

[tor]
datadir = ${paths:sbws_home}/tor
+1 −2
Original line number Diff line number Diff line
@@ -105,8 +105,7 @@ def read_started_ts(conf):

    :param ConfigParser conf: configuration
    """
    filepath = os.path.join(conf['paths']['datadir'],
                            conf['scanner']['started_filepath'])
    filepath = conf['paths']['started_filepath']
    with FileLock(filepath):
        with open(filepath, 'r') as fd:
            generator_started = fd.read()
+1 −2
Original line number Diff line number Diff line
@@ -286,8 +286,7 @@ def write_start_ts(conf):
    """
    generator_started = str(time.time())
    log.info('Scanner started at {}'.format(generator_started))
    filepath = os.path.join(conf['paths']['datadir'],
                            conf['scanner']['started_filepath'])
    filepath = conf['paths']['started_filepath']
    with FileLock(filepath):
        with open(filepath, 'w') as fd:
            fd.write(generator_started)
+2 −1
Original line number Diff line number Diff line
@@ -143,7 +143,8 @@ def _validate_paths(conf):
    sec = 'paths'
    err_tmpl = Template('$sec/$key ($val): $e')
    unvalidated_keys = [
        'datadir', 'sbws_home', 'v3bw_fname', 'tor_control_socket']
        'datadir', 'sbws_home', 'v3bw_fname', 'tor_control_socket',
        'started_filepath']
    all_valid_keys = unvalidated_keys
    errors.extend(_validate_section_keys(conf, sec, all_valid_keys, err_tmpl))
    return errors