Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

threading: default to 1 thread #35

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions data_diff/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
@click.option("-v", "--verbose", is_flag=True, help="Print extra info")
@click.option("-i", "--interactive", is_flag=True, help="Confirm queries, implies --debug")
@click.option(
"-j", "--threads", default=None, help="Number of threads to use. 1 means no threading. Auto if not specified."
"-j", "--threads", default='1', help="Number of threads to use. Default of 1 means no threading."
)
def main(
db1_uri,
Expand Down Expand Up @@ -77,10 +77,13 @@ def main(
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT, datefmt=DATE_FORMAT)

if threads is not None:
threads = int(threads)
if threads < 1:
logging.error("Error: threads must be >= 1")
return
if threads.lower() == 'auto':
threads = None
else:
threads = int(threads)
if threads < 1:
logging.error("Error: threads must be >= 1")
return

db1 = connect_to_uri(db1_uri, threads)
db2 = connect_to_uri(db2_uri, threads)
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
-c maintenance_work_mem=1GB
-c max_wal_size=8GB
restart: always
volumes:
volumes:
- postgresql-data:/var/lib/postgresql/data:delegated
ports:
- '5432:5432'
Expand All @@ -32,13 +32,13 @@ services:
--default-authentication-plugin=mysql_native_password
--binlog-cache-size=16M
--key_buffer_size=0
--max_connections=10
--max_connections=1000
--innodb_flush_log_at_trx_commit=2
--innodb_flush_log_at_timeout=10
--innodb_log_compressed_pages=OFF
--sync_binlog=0
restart: always
volumes:
volumes:
- mysql-data:/var/lib/mysql:delegated
user: mysql
ports:
Expand Down