Skip to content

Commit

Permalink
yearly download stat added
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshhewabi committed Feb 19, 2025
1 parent a88f522 commit f9cc5fa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
29 changes: 27 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,27 @@ process update_project_download_counts {
"""
}

process update_project_yearly_download_counts {

label 'error_retry'

input:
path project_level_yearly_download_counts // The JSON file to upload

output:
path "upload_response_file_downloads_YEARLY_per_project.txt" // Capture the response from the server

script:
"""
curl --location --max-time 300 '${params.api_endpoint_file_downloads_per_project}' \
--header '${params.api_endpoint_header}' \
--form 'files=@\"${project_level_yearly_download_counts}\"' > upload_response_file_downloads_YEARLY_per_project.txt
"""
}

process update_file_level_download_counts {

label 'process_medium_memory'
// label 'process_medium_memory'
label 'error_retry'

input:
Expand Down Expand Up @@ -314,7 +332,14 @@ workflow {
println "Skipping update_project_download_counts because disable_db_update=true"
}

// Step 6: Update project level downloads in MongoDB
// Step 6: Update project level YEARLY downloads in MongoDB
if (!params.disable_db_update) {
update_project_yearly_download_counts(analyze_parquet_files.out.project_level_yearly_download_counts)
} else {
println "Skipping update_project_yearly_download_counts because disable_db_update=true"
}

// Step 7: Update project level downloads in MongoDB
if (!params.disable_db_update) {
update_file_level_download_counts(analyze_parquet_files.out.file_level_download_counts)
} else {
Expand Down
2 changes: 1 addition & 1 deletion params/pride-ebislurm-params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ resource_base_url: 'https://www.ebi.ac.uk/pride/archive/projects/'
report_copy_filepath:

############# Push to a Database(e.g MongoDB) #############
disable_db_update: true
disable_db_update: false
log_file_batch_size: 1000
chunk_size: 100000

0 comments on commit f9cc5fa

Please sign in to comment.