Commit 27965ef572d36a35405bfb59f0a924ca08a6247f
- Diff rendering mode:
- inline
- side by side
web/datainput.py
(7 / 6)
|   | |||
| 117 | 117 | ||
| 118 | 118 | response += "Beginning your upload of "+typename+"\n" | |
| 119 | 119 | response += "TypeID: " + typeid + " RegionID: " + region + "\n" | |
| 120 | cur.execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED') | ||
| 120 | #cur.execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED') | ||
| 121 | 121 | ||
| 122 | 122 | # Pre-validate the data coming in | |
| 123 | 123 | for line in data: | |
| … | … | ||
| 132 | 132 | return # invalid data | |
| 133 | 133 | ||
| 134 | 134 | ||
| 135 | cur.execute('LOCK TABLE users IN SHARE ROW EXCLUSIVE MODE') | ||
| 135 | #cur.execute('LOCK TABLE users IN SHARE ROW EXCLUSIVE MODE') | ||
| 136 | 136 | ||
| 137 | cur.execute('UPDATE users SET uploads = uploads + 1 WHERE userid = %s', [userid]) | ||
| 138 | db.commit() | ||
| 137 | #cur.execute('UPDATE users SET uploads = uploads + 1 WHERE userid = %s', [userid]) | ||
| 138 | #db.commit() | ||
| 139 | 139 | ||
| 140 | 140 | ||
| 141 | 141 | cur.execute('DELETE FROM current_market WHERE typeid = %s AND regionid = %s', [typeid, region]) | |
| 142 | db.commit() | ||
| 142 | #db.commit() | ||
| 143 | 143 | ||
| 144 | 144 | ||
| 145 | 145 | if typename: | |
| … | … | ||
| 185 | 185 | ||
| 186 | 186 | cur.execute("SELECT count(orderid) FROM archive_market WHERE orderid = %s AND volremain = %s AND regionid = %s", [ line[4], int(float(line[1])), region]) | |
| 187 | 187 | hasdata = cur.fetchone() | |
| 188 | if not hasdata: | ||
| 188 | hasdata = hasdata[0] | ||
| 189 | if hasdata == 0: | ||
| 189 | 190 | response += "This includes new order informaion " | |
| 190 | 191 | cur.execute(""" | |
| 191 | 192 | INSERT INTO archive_market (regionid, systemid, stationid, typeid, |

