Skip to content

Commit 609cc9a

Browse files
committed
Update mfp_data_download_db_insert.py
1 parent d4c5ed7 commit 609cc9a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/mfp_data_download_db_insert.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,14 @@ def dwnld_insert_nutrition(mfp_username,mfp_password,ath_un,start_date,end_date,
8686
date_in_range = single_date.strftime("%Y-%m-%d")
8787
data_exist_for_date = 'Nutrition_Data_For_'+date_in_range
8888

89-
#PG: Check whether the data for this date have been inserted into to DB during one of the previous runs
90-
if auto_synch == False:
91-
data_exists = check_data_file_exists(data_exist_for_date,ath_un,db_host,db_name,superuser_un,superuser_pw,encr_pass)
92-
if data_exists == True:
93-
with StdoutRedirection(ath_un):
94-
print(('Nutrition data for {} already downloaded and inserted to DB. Skipping.'.format(date_in_range)))
95-
with ProgressStdoutRedirection(ath_un):
96-
print(('Nutrition data for {} already downloaded and inserted to DB. Skipping.'.format(date_in_range)))
97-
continue
89+
#PG: Check whether the data for this date have been inserted into to DB during one of the previous runs
90+
data_exists = check_data_file_exists(data_exist_for_date,ath_un,db_host,db_name,superuser_un,superuser_pw,encr_pass)
91+
if data_exists == True:
92+
with StdoutRedirection(ath_un):
93+
print(('Nutrition data for {} already downloaded and inserted to DB. Skipping.'.format(date_in_range)))
94+
with ProgressStdoutRedirection(ath_un):
95+
print(('Nutrition data for {} already downloaded and inserted to DB. Skipping.'.format(date_in_range)))
96+
continue
9897

9998
with StdoutRedirection(ath_un):
10099
print(('Downloading nutrition data: '+date_in_range))

0 commit comments

Comments
 (0)