Skip to content

Commit

Permalink
Merge pull request #59 from UMCUGenetics/hotfix/v3.4.1
Browse files Browse the repository at this point in the history
Hotifx/v3.4.1 - Fix sql timeouts when uploading samples with high coverage.
  • Loading branch information
rernst authored Apr 8, 2022
2 parents d8cf9fb + 08202d6 commit 9fab496
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ExonCov/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def run(self, project_name, sample_type, bam, exon_bed_file, threads, overwrite,
sample.exon_measurement_file = '{0}_{1}.txt'.format(sample.id, sample.exon_measurement_file)
db.session.add(sample)
db.session.commit()
# Store sample_id and close session before starting Sambamba
sample_id = sample.id
db.session.close()

# Create temp_dir
if not temp_path:
Expand Down Expand Up @@ -264,6 +267,7 @@ def run(self, project_name, sample_type, bam, exon_bed_file, threads, overwrite,
os.system('rsync {0}* {1}'.format(exon_measurement_file_path_gz, app.config['EXON_MEASUREMENTS_RSYNC_PATH']))

# Change exon_measurement_file to path on server.
sample = Sample.query.get(sample_id)
sample.exon_measurement_file = '{0}/{1}.gz'.format(
app.config['EXON_MEASUREMENTS_RSYNC_PATH'].split(':')[-1],
sample.exon_measurement_file
Expand Down
7 changes: 7 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False

# SQLAlchemy CLI settings, enable when using CLI
# SQLALCHEMY_ENGINE_OPTIONS = {
# 'pool_size' : 1,
# 'pool_recycle': 120,
# 'pool_pre_ping': True
# }

# FlaskForm
SECRET_KEY = 'change_this'

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Flask-Login==0.4.1
Flask-Migrate==2.5.2
Flask-Script==2.0.6
Flask-Security==3.0.0
Flask-SQLAlchemy==2.3.2
Flask-SQLAlchemy==2.4.4
Flask-WTF==0.14.2
MySQL-python==1.2.5
SQLAlchemy==1.3.5
Expand Down

0 comments on commit 9fab496

Please sign in to comment.