reservations working properly. Still missing rate control

history-download
youainti 4 years ago
parent 820f082e0d
commit 2aa8fdee4e

@ -189,8 +189,7 @@ def reserve_trials(db_connection, limit=10):
query = """ query = """
WITH OF_INTEREST AS WITH OF_INTEREST AS
(SELECT NCT_ID (SELECT NCT_ID
FROM HTTP.MOST_RECENT_DOWNLOAD_STATUS FROM HTTP.TRIALS_TO_DOWNLOAD
WHERE HTTP.MOST_RECENT_DOWNLOAD_STATUS.STATUS = 'Of Interest'::HTTP.HISTORY_DOWNLOAD_STATUS
LIMIT %s LIMIT %s
) )
INSERT INTO HTTP.DOWNLOAD_STATUS (NCT_ID,STATUS) INSERT INTO HTTP.DOWNLOAD_STATUS (NCT_ID,STATUS)
@ -229,11 +228,11 @@ if __name__ == "__main__":
#get list of nct_ids #get list of nct_ids
nctids = reserve_trials(con, 4) nctids = reserve_trials(con, 100)
print(nctids) print(nctids)
#start analyzing them #start analyzing them
with Pool(processes=3) as process_pool: with Pool(processes=4) as process_pool:
process_pool.map(downloader, nctids) process_pool.map(downloader, nctids)

Loading…
Cancel
Save