ksort commited on
Commit
9d31645
·
1 Parent(s): ed38084

update upload

Browse files
Files changed (1) hide show
  1. serve/upload.py +2 -2
serve/upload.py CHANGED
@@ -12,7 +12,7 @@ ssh_client = None
12
  sftp_client = None
13
  sftp_client_imgs = None
14
 
15
- def open_sftp():
16
  global ssh_client
17
  sftp_client = ssh_client.open_sftp()
18
  return sftp_client
@@ -28,7 +28,7 @@ def create_ssh_client(server, port, user, password):
28
  transport.set_keepalive(60)
29
 
30
  with concurrent.futures.ThreadPoolExecutor() as executor:
31
- futures = [executor.submit(ssh_client) for _ in range(5)]
32
  results = [future.result() for future in futures]
33
 
34
  sftp_client = results[0]
 
12
  sftp_client = None
13
  sftp_client_imgs = None
14
 
15
+ def open_sftp(i=0):
16
  global ssh_client
17
  sftp_client = ssh_client.open_sftp()
18
  return sftp_client
 
28
  transport.set_keepalive(60)
29
 
30
  with concurrent.futures.ThreadPoolExecutor() as executor:
31
+ futures = [executor.submit(open_sftp, i) for i in range(5)]
32
  results = [future.result() for future in futures]
33
 
34
  sftp_client = results[0]