Skip to content

Commit aec11c9

Browse files
committed
moved current time inside the method
1 parent 5aec467 commit aec11c9

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include .env
22

33
.EXPORT_ALL_VARIABLES:
4-
APP_NAME=my-app-name
4+
APP_NAME=nyt-movies-app1
55

66
TAG=latest
77
TF_VAR_app_name=${APP_NAME}

app/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ FROM python:3.11-slim
22
WORKDIR /app
33
COPY . /app
44
RUN pip install --no-cache-dir -r requirements.txt
5+
RUN pip install httpx
56
EXPOSE 80
67
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]

app/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ def extract_article_info(data):
2828
Returns:
2929
list: A list of dictionaries, each containing the extracted information for one article.
3030
"""
31-
current_time = datetime.now().strftime("%H:%M:%S")
32-
print("extract_article_info Run time is:", current_time)
31+
32+
3333

3434
articles_info = []
3535

3636
for article in data["response"]["docs"]:
37+
current_time = datetime.now().strftime("%H:%M:%S")
3738
abstract = article.get("abstract") # Use .get() to handle missing keys
3839
web_url = article.get("web_url")
3940

@@ -58,7 +59,9 @@ def extract_article_info(data):
5859
"headlines": grouped_headlines,
5960
"keywords": grouped_keywords,
6061
"author_name": author_name,
62+
"current_time": current_time
6163
})
64+
print("extract_article_info Run time is:", current_time)
6265
return articles_info
6366

6467
@app.get("/")

infra/setup/variable.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ variable "app_name" {
22
description = "Name of the app."
33
type = string
44
}
5+
variable "region" {
6+
description = "AWS region"
7+
type = string
8+
}

0 commit comments

Comments
 (0)