mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Lazy loading for performance, possibly
This commit is contained in:
parent
da112a3668
commit
f78af06a35
1 changed files with 4 additions and 2 deletions
|
@ -27,8 +27,6 @@
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import requests
|
|
||||||
import socket
|
|
||||||
|
|
||||||
from moulinette import m18n, msettings
|
from moulinette import m18n, msettings
|
||||||
from moulinette.utils import log
|
from moulinette.utils import log
|
||||||
|
@ -496,6 +494,10 @@ class Diagnoser():
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def remote_diagnosis(uri, data, ipversion, timeout=30):
|
def remote_diagnosis(uri, data, ipversion, timeout=30):
|
||||||
|
|
||||||
|
# Lazy loading for performance
|
||||||
|
import requests
|
||||||
|
import socket
|
||||||
|
|
||||||
# Monkey patch socket.getaddrinfo to force request() to happen in ipv4
|
# Monkey patch socket.getaddrinfo to force request() to happen in ipv4
|
||||||
# or 6 ...
|
# or 6 ...
|
||||||
# Inspired by https://stackoverflow.com/a/50044152
|
# Inspired by https://stackoverflow.com/a/50044152
|
||||||
|
|
Loading…
Add table
Reference in a new issue