Skip to content

Commit 34f533f

Browse files
authored
Merge pull request #244 from GispoCoding/Fix_lambda_libraries
Fix lambdas.
2 parents 7863f1e + 948852e commit 34f533f

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

backend/lambda_functions/lipas_loader/lipas_loader.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def __init__(
5050
**kwargs,
5151
) -> None:
5252
super().__init__(connection_string, **kwargs)
53-
self.feature_counter: int = 0 # Sorry but this had to be done :-)
5453

5554
self.type_codes_all_year = (
5655
type_codes_all_year
@@ -87,6 +86,7 @@ def get_features(self, only_page: Optional[int] = None) -> List[int]: # type: i
8786
r = requests.get(url, params=params, headers=self.HEADERS)
8887
r.raise_for_status()
8988
data = r.json()
89+
9090
if data:
9191
ids += [item[ID_FIELD] for item in data if "location" in item]
9292
current_page += 1
@@ -160,8 +160,7 @@ def get_feature(self, sports_place_id: int): # type: ignore[override]
160160
"deleted": False,
161161
"tarmo_category": tarmo_category,
162162
}
163-
# LOGGER.info(f"Features loaded: {len(flattened)}")
164-
self.feature_counter = self.feature_counter + 1
163+
# LOGGER.info(f"Features loaded: {len(flattened)}")
165164
return flattened
166165

167166
def save_feature(self, sport_place: Dict[str, Any], session: Session) -> bool:
@@ -219,7 +218,7 @@ def _sport_places_url_and_params(self, page: int) -> Tuple[str, Dict[str, Any]]:
219218
return main_url, params
220219

221220
def _sport_place_url(self, sports_place_id: int):
222-
# print(self.api_url)
221+
print(self.api_url)
223222
return "/".join((self.api_url, LipasLoader.SPORT_PLACES, str(sports_place_id)))
224223

225224

infra/lambda.tf

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resource "aws_lambda_function" "db_manager" {
22
function_name = "${var.prefix}-db_manager"
33
filename = "../backend/lambda_functions/db_manager.zip"
4-
runtime = "python3.8"
4+
runtime = "python3.10"
55
handler = "db_manager.handler"
66
memory_size = 128
77
timeout = 120
@@ -31,7 +31,7 @@ resource "aws_lambda_function" "db_manager" {
3131
resource "aws_lambda_function" "lipas_loader" {
3232
function_name = "${var.prefix}-lipas_loader"
3333
filename = "../backend/lambda_functions/lipas_loader.zip"
34-
runtime = "python3.8"
34+
runtime = "python3.10"
3535
handler = "app.lipas_loader.handler"
3636
memory_size = 128
3737
timeout = 900
@@ -64,7 +64,7 @@ resource "aws_lambda_permission" "cloudwatch_call_lipas_loader" {
6464
resource "aws_lambda_function" "osm_loader" {
6565
function_name = "${var.prefix}-osm_loader"
6666
filename = "../backend/lambda_functions/osm_loader.zip"
67-
runtime = "python3.8"
67+
runtime = "python3.10"
6868
handler = "app.osm_loader.handler"
6969
memory_size = 256
7070
timeout = 900
@@ -97,7 +97,7 @@ resource "aws_lambda_permission" "cloudwatch_call_osm_loader" {
9797
resource "aws_lambda_function" "wfs_loader" {
9898
function_name = "${var.prefix}-wfs_loader"
9999
filename = "../backend/lambda_functions/wfs_loader.zip"
100-
runtime = "python3.8"
100+
runtime = "python3.10"
101101
handler = "app.wfs_loader.handler"
102102
memory_size = 128
103103
timeout = 900
@@ -130,7 +130,7 @@ resource "aws_lambda_permission" "cloudwatch_call_wfs_loader" {
130130
resource "aws_lambda_function" "arcgis_loader" {
131131
function_name = "${var.prefix}-arcgis_loader"
132132
filename = "../backend/lambda_functions/arcgis_loader.zip"
133-
runtime = "python3.8"
133+
runtime = "python3.10"
134134
handler = "app.arcgis_loader.handler"
135135
memory_size = 256
136136
timeout = 900
@@ -164,7 +164,7 @@ resource "aws_lambda_function" "notifier" {
164164
count = var.SLACK_HOOK_URL == "" ? 0 : 1
165165
function_name = "${var.prefix}-notifier"
166166
filename = "../backend/lambda_functions/notifier.zip"
167-
runtime = "python3.8"
167+
runtime = "python3.10"
168168
handler = "app.notifier.handler"
169169
memory_size = 128
170170
timeout = 900

0 commit comments

Comments
 (0)