😊
08:30 AM
09:00 AM
10:00 AM
11:00 AM
11:30 AM
🙂🖥️🦗🦗 😅🖥️🦗🦗 🙂🖥️🦗🦗 🙂🖥️🦗🦗
12:00 AM
12:30 AM
😱🖥️🦗🦗🦗🦗🦗🦗🦗🦗
😭🖥️🦗🦗🦗🦗🦗🦗🦗🦗
😱🖥️🦗🦗🦗🦗🦗🦗🦗🦗
😱🖥️🦗🦗🦗🦗🦗🦗🦗🦗
12:35 AM
🤔
🤔 🤔
🤔
12:40 AM
🤔
😀 🤔
🤔
12:41 AM
😀🤖
😎🤖🦗🦗
😍🤖🦗🦗
😎🤖🦗🦗
😎🤖🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
12:45 AM
13:00 AM
😱🤖🦗🦗🦗🦗🦗🦗🦗🦗
😭🤖🦗🦗🦗🦗🦗🦗🦗🦗
😱🤖🦗🦗🦗🦗🦗🦗🦗🦗
😱🤖🦗🦗🦗🦗🦗🦗🦗🦗
🦗 = ? 💺🖥️ = ? 😊 = ? 🤖 = ?
😊
$ python run.py
$ uwsgi --http :5000 --processes 4 --file run.py --callable app
$ gunicorn --bind :5000 --workers 4 run:app
$ cat tweepy.ini
[uwsgi]
master = true
protocol = http
socket = 0.0.0.0:5000
file = run.py
callable = app
processes = 4
$ uwsgi tweepy.ini
tweets_cache = {}
@app.route("/tweets", methods=["GET"])
def get_tweets():
...
tweets = tweets_cache.get(user_id)
if not tweets:
tweets = query_tweets(...)
tweets_cache[user_id] = tweets
...
@app.route("/tweets", methods=["POST"])
def post_tweets():
...
tweet.save()
tweets_cache.pop(user_id)
...
@cache()
def query_tweets(user_id, ...):
...
@app.route("/tweets", methods=["GET"])
def get_tweets():
...
query_tweets(user_id, ...)
...
@app.route("/tweets", methods=["POST"])
def post_tweets():
...
query_tweets.invalidate(user_id)
...
😱🤖🦗🦗🦗🦗🦗🦗🦗🦗
😭🤖🦗🦗🦗🦗🦗🦗🦗🦗
😱🤖🦗🦗🦗🦗🦗🦗🦗🦗
😱🤖🦗🦗🦗🦗🦗🦗🦗🦗
😎🤖🦗🦗 😎🤖🦗🦗 😎🤖🦗🦗 😎🤖🦗🦗 😎🤖🦗🦗 😎🤖🦗🦗 😎🤖🦗🦗 😎🤖🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗
🦗🦗🦗🦗
🦗🦗
🦗🦗
🦗🦗