Skip to content

Commit

Permalink
fix: remove response timer (#12)
Browse files Browse the repository at this point in the history
* fix: remove response timer

* fix: update hyperon-das-atomdb
  • Loading branch information
levisingularity authored Nov 13, 2023
1 parent 2e97186 commit fae0bf3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def load_env():
os.environ[value] = f.readline().strip()
else:
env_value = os.environ.get(key, None)
if env_value is None:
raise Exception(f"Environment variable {key} is empty")
# if env_value is None:
# raise Exception(f"Environment variable {key} is empty")
os.environ[value] = env_value


Expand Down
18 changes: 9 additions & 9 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _get_payload(event: any):


def handle(event: any, context=None):
start = time.time()
# start = time.time()

payload = validate(EventValidator(), _get_payload(event))
result = None
Expand Down Expand Up @@ -280,20 +280,20 @@ def handle(event: any, context=None):
result = dict(error=f'The action {payload["action"]} was not found')
http_code_response = 400

end = time.time()
total = end - start
# end = time.time()
# total = end - start

data = {
"result": result,
"timestamp": total,
}
# data = {
# "result": result,
# "timestamp": total,
# }

return (
data
result
if context is None
else (
context.status(http_code_response)
.headers({"Content-Type": "application/json"})
.success(data)
.success(result)
)
)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
hyperon-das-atomdb==0.1.7
hyperon-das-atomdb~=0.2
incoming==0.3.1

0 comments on commit fae0bf3

Please sign in to comment.