Skip to content

Commit

Permalink
Reduce addUPI telemetry slots to 10000
Browse files Browse the repository at this point in the history
Some addUPI servers have max allowed slots 10000, and the 20000 that we
had didn't work. This is a (hopefully) temporary fix; we must change it
to get the max slots from the config.
  • Loading branch information
aptiko committed Jul 31, 2023
1 parent 22cd685 commit 7f7c37d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions enhydris/telemetry/tests/test_types/test_addupi.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_makes_request(self, mock_requests_get):
# 1655193600 is 2022-06-14T08:00 in seconds from the epoch
mock_requests_get.assert_called_once_with(
"http://1.2.3.4/addUPI?function=getdata&id=8231&df=time_t"
"&date=1655193600&slots=20000&session-id=topsecretsessionid",
"&date=1655193600&slots=10000&session-id=topsecretsessionid",
verify=False,
)

Expand All @@ -178,7 +178,7 @@ def test_request_when_no_start_date(self, mock_requests_get):
self.telemetry_api_client.get_measurements(8231, None)
mock_requests_get.assert_called_once_with(
"http://1.2.3.4/addUPI?function=getdata&id=8231&df=time_t"
"&date=631152000&slots=20000&session-id=topsecretsessionid",
"&date=631152000&slots=10000&session-id=topsecretsessionid",
verify=False,
)

Expand Down
2 changes: 1 addition & 1 deletion enhydris/telemetry/types/addupi.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_measurements(self, sensor_id, timeseries_end_date):
f"&id={sensor_id}"
f"&df=time_t"
f"&date={int(timeseries_end_date.timestamp())}"
"&slots=20000"
"&slots=10000"
)
result = ""
prev_timestamp = None
Expand Down

0 comments on commit 7f7c37d

Please sign in to comment.