abrar0503 commited on
Commit
e1cfaba
·
verified ·
1 Parent(s): 55e4b0c

Update src/do_nothing_lambda/handler.py

Browse files
Files changed (1) hide show
  1. src/do_nothing_lambda/handler.py +12 -0
src/do_nothing_lambda/handler.py CHANGED
@@ -1,4 +1,6 @@
1
  import logging
 
 
2
 
3
 
4
  logger = logging.getLogger()
@@ -7,3 +9,13 @@ logger.setLevel(logging.INFO)
7
 
8
  def execute(event, context):
9
  logger.info("Received Event: %s", event)
 
 
 
 
 
 
 
 
 
 
 
1
  import logging
2
+ from flask import Flask
3
+ from flask_caching import Cache
4
 
5
 
6
  logger = logging.getLogger()
 
9
 
10
  def execute(event, context):
11
  logger.info("Received Event: %s", event)
12
+
13
+ config = {
14
+ "DEBUG": True, # some Flask specific configs
15
+ "CACHE_TYPE": "SimpleCache", # Flask-Caching related configs
16
+ "CACHE_DEFAULT_TIMEOUT": 300
17
+ }
18
+ app = Flask(__name__)
19
+ # tell Flask to use the above defined config
20
+ app.config.from_mapping(config)
21
+ cache = Cache(app)