Skip to content

Commit

Permalink
fixing fallback #39 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Jun 30, 2022
1 parent b5c7aae commit f14449d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions s2t_miv.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ def upload_all_pairs(conn, tables, start, end, vType, real_routes, rep_routes, n
def create_all_pairs(conn, key, params):
cursor = conn.cursor()
schema_table, table, exists = db_manipulator.check_schema_table(conn, 'temp', '%s_%s' % (params[SP.od_output], key))
if exists:
cursor.execute("DROP TABLE " + schema_table)
createQuery = """
CREATE TABLE %s
(
Expand All @@ -250,6 +248,7 @@ def create_all_pairs(conn, key, params):
)
"""
try:
cursor.execute("DROP TABLE IF EXISTS " + schema_table)
cursor.execute(createQuery % (schema_table, table))
except Exception:
conn.rollback()
Expand Down
6 changes: 1 addition & 5 deletions tsc_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,7 @@ def simulation_request(options, request):
_, _, exists = db_manipulator.check_schema_table(conn, 'temp', '%s_%s' % (params[SP.trip_output], sim_key))
if not exists or options.overwrite:
write_status('>> starting trip result database upload', sim_key, params, conn)
try:
s2t_miv.upload_trip_results(conn, sim_key, params, final_routes)
except ProgrammingError as message:
conn.rollback()
write_status(message, sim_key, params, conn, constants.MSG_TYPE.error)
s2t_miv.upload_trip_results(conn, sim_key, params, final_routes)
write_status('<< finished trip result database upload', sim_key, params, conn)
print()
# run all pair calculations
Expand Down

0 comments on commit f14449d

Please sign in to comment.