Skip to content

Commit 3888881

Browse files
committed
Add location query to send_sqm_data.py
1 parent 4217702 commit 3888881

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

send_sqm_data.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def serializer(obj):
1616
else:
1717
return obj
1818

19-
response = requests.get(API_URL + 'latest/')
19+
response = requests.get(API_URL + 'latest/?location=' + API_LOCATION)
2020

2121
if response.status_code == 404:
2222
latest = False
@@ -27,11 +27,11 @@ def serializer(obj):
2727
cur = conn.cursor()
2828

2929
select_stmt = "SELECT * FROM %s" % DB_TABLE
30-
3130
if latest:
32-
cur.execute(select_stmt + " WHERE timestamp > %s", (latest, ))
33-
else:
34-
cur.execute(select_stmt)
31+
select_stmt += ' WHERE timestamp > \'%s\'' % latest
32+
select_stmt += ' ORDER BY timestamp limit 100000'
33+
34+
cur.execute(select_stmt)
3535

3636
rows = cur.fetchall()
3737

0 commit comments

Comments
 (0)