mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-15 01:42:05 +08:00
Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
This commit is contained in:
@@ -134,10 +134,16 @@ class Uploader(object):
|
||||
total_size += os.stat(fn).st_size
|
||||
return dict(name_counts), total_size
|
||||
|
||||
def next_file_to_compress(self):
|
||||
for name, key, fn in self.gen_upload_files():
|
||||
if name == "rlog":
|
||||
return (key, fn, 0)
|
||||
return None
|
||||
|
||||
def next_file_to_upload(self, with_video):
|
||||
# try to upload log files first
|
||||
for name, key, fn in self.gen_upload_files():
|
||||
if name in ["rlog", "rlog.bz2"]:
|
||||
if name == "rlog.bz2":
|
||||
return (key, fn, 0)
|
||||
|
||||
if with_video:
|
||||
@@ -208,7 +214,7 @@ class Uploader(object):
|
||||
raise_on_thread(thread, SystemExit)
|
||||
thread.join()
|
||||
|
||||
def upload(self, key, fn):
|
||||
def compress(self, key, fn):
|
||||
# write out the bz2 compress
|
||||
if fn.endswith("log"):
|
||||
ext = ".bz2"
|
||||
@@ -221,6 +227,9 @@ class Uploader(object):
|
||||
key += ext
|
||||
fn += ext
|
||||
|
||||
return (key, fn)
|
||||
|
||||
def upload(self, key, fn):
|
||||
try:
|
||||
sz = os.path.getsize(fn)
|
||||
except OSError:
|
||||
@@ -275,6 +284,12 @@ def uploader_fn(exit_event):
|
||||
if exit_event.is_set():
|
||||
return
|
||||
|
||||
d = uploader.next_file_to_compress()
|
||||
if d is not None:
|
||||
key, fn, _ = d
|
||||
uploader.compress(key, fn)
|
||||
continue
|
||||
|
||||
if not should_upload:
|
||||
time.sleep(5)
|
||||
continue
|
||||
|
||||
@@ -35,7 +35,8 @@ from selfdrive.version import version, dirty
|
||||
|
||||
OVERPASS_API_URL = "https://overpass.kumi.systems/api/interpreter"
|
||||
OVERPASS_HEADERS = {
|
||||
'User-Agent': 'NEOS (comma.ai)'
|
||||
'User-Agent': 'NEOS (comma.ai)',
|
||||
'Accept-Encoding': 'gzip'
|
||||
}
|
||||
|
||||
last_gps = None
|
||||
|
||||
Reference in New Issue
Block a user