Commit 7afb1bd6 authored by ibuler's avatar ibuler

[Update] 修改命令上传

parent 30713105
...@@ -9,7 +9,6 @@ import threading ...@@ -9,7 +9,6 @@ import threading
import json import json
import signal import signal
import copy import copy
from collections import defaultdict
from .conf import config from .conf import config
from .sshd import SSHServer from .sshd import SSHServer
......
...@@ -170,9 +170,10 @@ class CommandRecorder(object): ...@@ -170,9 +170,10 @@ class CommandRecorder(object):
if not data_set: if not data_set:
continue continue
logger.debug("Send {} commands to server".format(len(data_set))) logger.debug("Send {} commands to server".format(len(data_set)))
ok = self.storage.bulk_save(data_set) for i in range(5):
if not ok: ok = self.storage.bulk_save(data_set)
self.queue.mput(data_set) if ok:
break
thread = threading.Thread(target=func) thread = threading.Thread(target=func)
thread.daemon = True thread.daemon = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment