Skip to content

Instantly share code, notes, and snippets.

@snower
snower / rproxy.py
Last active August 29, 2015 14:13
auto static refresh time proxy
# -*- coding: utf-8 -*-
# 14/12/16
# create by: snower
import sys
import time
import re
import logging
import traceback
from tornado.ioloop import IOLoop
#!/usr/bin/env python
"""
How to use it:
1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID` , The Tornado Web Server Will shutdown after process all the request.
2. When you run it behind Nginx, it can graceful reboot your production server.
3. Nice Print in http://weibo.com/1682780325/zgkb7g8k7
"""