Qilan2 commited on
Commit
3548df1
·
verified ·
1 Parent(s): 4fc2689

Update server2.py

Browse files
Files changed (1) hide show
  1. server2.py +6 -6
server2.py CHANGED
@@ -459,9 +459,9 @@ def monitor_port():
459
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
460
  result = sock.connect_ex(('localhost', 8000))
461
  if result == 0:
462
- print(f"端口 {port} 正在使用中")
463
  else:
464
- print(f"端口 {port} 未被使用")
465
  subprocess.Popen('yes | sh /sillytavern/start.sh', shell=True)
466
  time.sleep(15)
467
  time.sleep(5)
@@ -525,10 +525,10 @@ def SillyTavern():
525
  print(f"Command '{e.cmd}' returned non-zero exit status {e.returncode}.")
526
  print("Output:", e.output)
527
  os.chdir('/sillytavern')
528
- subprocess.run('yes | sh /sillytavern/start.sh', shell=True, check=True)
529
- subprocess.run('yes | sh /sillytavern/start.sh', shell=True, check=True)
530
- subprocess.run('yes | sh /sillytavern/start.sh', shell=True, check=True)
531
- subprocess.run('yes | sh /sillytavern/start.sh', shell=True, check=True)
532
  print('-----------SillyTavern结束-------------')
533
  threading.Thread(target=SillyTavern, daemon=True).start()
534
  time.sleep(60)
 
459
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
460
  result = sock.connect_ex(('localhost', 8000))
461
  if result == 0:
462
+ print(f"端口 8000 正在使用中")
463
  else:
464
+ print(f"端口 8000 未被使用")
465
  subprocess.Popen('yes | sh /sillytavern/start.sh', shell=True)
466
  time.sleep(15)
467
  time.sleep(5)
 
525
  print(f"Command '{e.cmd}' returned non-zero exit status {e.returncode}.")
526
  print("Output:", e.output)
527
  os.chdir('/sillytavern')
528
+ # subprocess.run('yes | sh /sillytavern/start.sh', shell=True, check=True)
529
+ # subprocess.run('yes | sh /sillytavern/start.sh', shell=True, check=True)
530
+ # subprocess.run('yes | sh /sillytavern/start.sh', shell=True, check=True)
531
+ # subprocess.run('yes | sh /sillytavern/start.sh', shell=True, check=True)
532
  print('-----------SillyTavern结束-------------')
533
  threading.Thread(target=SillyTavern, daemon=True).start()
534
  time.sleep(60)