Skip to content

Instantly share code, notes, and snippets.

View KimDoKy's full-sized avatar
:octocat:
dev server....

Kim Do Ky KimDoKy

:octocat:
dev server....
View GitHub Profile
@KimDoKy
KimDoKy / gist:37c2b6f0a24176aabdb586f476709d23
Last active June 25, 2019 13:13
Unexplainable timeout error on EC2.
I created django api server on ec2.
That's use nginx, uWSGI.
I meeted unexplain issue.
Api server have simple two endpoint that 'A endpoint', 'B endpoint'.
'B endpoint' return simple string.
'A endpoint' do request 'B endpoint' at inner function of 'A endpoint'.
```python
# models.py
class Team(models.Model):
team_1 = models.CharField(max_length=50)
team_2 = models.ForeignKey('Team', on_delete=models.CASCADE, blank=True, null=True)
class CustomUser(AbstractUser):
LEVER_CHOICE = (
('lv1','ceo'),
...
def myfilter(filter_fn, alter_value):
def wrap(fn):
def inner(*args):
true_list = [x if filter_fn(x) else alter_value for x in args]
return fn(*true_list)
return inner
return wrap
@myfilter(lambda i: i%2==0, 0)
def mysum(a,b,c,d,e):
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from selenium import webdriver
>>> browser = webdriver.Chrome()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/.local/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/home/ubuntu/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in __init__