Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import uwsgi
def hello():
return "Hello World"
print(uwsgi.register_rpc("hello", hello))
print(uwsgi.rpc(None, "hello"))
def __call__(self, f):
uwsgi.register_rpc(self.name, f)
return f
def __call__(self, f):
uwsgi.register_rpc(self.name, f)
return f
# Order by rowid gives us the last row added
try:
row = db_conn.execute("select host, port from gxrtproxy where key=? and key_type=? and token=? order by rowid desc limit 1", (key, key_type, token)).fetchone()
if row:
rval = '%s:%s' % (tuple(row))
return rval.encode()
break
except sqlite3.ProgrammingError:
db_conn = sqlite3.connect(realtime_db_file)
continue
break
return None
uwsgi.register_rpc('rtt_key_type_token_mapper', key_type_token_mapper)
uwsgi.register_rpc('rtt_key_type_token_mapper_cached', key_type_token_mapper_cached)
for i in range(2):
# Order by rowid gives us the last row added
try:
row = db_conn.execute("select host, port from gxrtproxy where key=? and key_type=? and token=? order by rowid desc limit 1", (key, key_type, token)).fetchone()
if row:
rval = '%s:%s' % (tuple(row))
return rval.encode()
break
except sqlite3.ProgrammingError:
db_conn = sqlite3.connect(realtime_db_file)
continue
break
return None
uwsgi.register_rpc('rtt_key_type_token_mapper', key_type_token_mapper)
uwsgi.register_rpc('rtt_key_type_token_mapper_cached', key_type_token_mapper_cached)
def __call__(self, f):
uwsgi.register_rpc(self.name, f)
return f
from uwsgicc import app
import uwsgi
def hello_world(name):
return "Hello World %s" % name
uwsgi.register_rpc("hello", hello_world)
uwsgi.set_warning_message("uWSGI is running the Control Center")
application = app