Revision 9516
Added by Aaron Marcuse-Kubitza over 11 years ago
bin/tnrs_db | ||
---|---|---|
82 | 82 |
header.insert(0, time_col_name) |
83 | 83 |
reader = csvs.ColInsertFilter(reader, now_str) |
84 | 84 |
sql_io.append_csv(db, tnrs_data, reader, header) |
85 |
process() |
|
85 |
# start transaction *before* submitting data, so Time_submitted is |
|
86 |
# correctly set to the submission time rather than the insertion time. |
|
87 |
# these may differ by several minutes if TNRS is slow. |
|
88 |
sql.with_savepoint(db, process) |
|
86 | 89 |
|
87 | 90 |
main() |
Also available in: Unified diff
bin/tnrs_db: start transaction before submitting data, so Time_submitted is correctly set to the submission time rather than the insertion time. these may differ by several minutes if TNRS is slow. the setting of the correct time can be tested by inserting `time.sleep(n_sec)` after the TNRS request, removing the explicit setting of Time_submitted, and checking that the Time_submitted is close to the time tnrs_db was run instead of n_sec seconds later.