1
0

More than 1 year has passed since last update.

Redis requires a monkey patched socket library to work with geventと表示される

Posted at
app.py
from gevent import monkey
monkey.patch_all()

をapp.py (flask runなどで使用しているファイル) の先頭に追加して解決。

Make the standard library cooperative.

The primary purpose of this module is to carefully patch, in place, portions of the standard library with gevent-friendly functions that behave in the same way as the original (at least as closely as possible).

The primary interface to this is the patch_all() function, which performs all the available patches. It accepts arguments to limit the patching to certain modules, but most programs should use the default values as they receive the most wide-spread testing, and some monkey patches have dependencies on others.

Patching should be done as early as possible in the lifecycle of the program. For example, the main module (the one that tests against __main__ or is otherwise the first imported) should begin with this code, ideally before any other imports:

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0