Skip to content

Commit

Permalink
unlink empty decoded file
Browse files Browse the repository at this point in the history
  • Loading branch information
baskiton committed Aug 21, 2023
1 parent ce50c33 commit 95d33db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sats_receiver/gr_modules/decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def _raw_finalize(log: logging.Logger,
st = res_fn.stat()
log.info('finish: %s (%s)', res_fn, utils.numbi_disp(st.st_size))
if not st.st_size:
res_fn.unlink(True)
return utils.Decode.NONE,

return dtype, sat_name, fin_key, res_fn, dt.datetime.fromtimestamp(st.st_mtime, dateutil.tz.tzutc())
Expand Down Expand Up @@ -283,6 +284,7 @@ def _apt_finalize(log: logging.Logger,
res_fn = res_fn.rename(res_fn.with_stem(res_fn.stem + subname))
log.info('finish: %s (%s)', res_fn, utils.numbi_disp(sz))
if not sz:
res_fn.unlink(True)
return utils.Decode.NONE,

return dtype, sat_name, fin_key, res_fn, a.end_time
Expand Down Expand Up @@ -364,6 +366,7 @@ def _constel_soft_finalize(log: logging.Logger,
st = res_fn.stat()
log.info('finish: %s (%s)', res_fn, utils.numbi_disp(st.st_size))
if not st.st_size:
res_fn.unlink(True)
return utils.Decode.NONE,

return dtype, sat_name, fin_key, res_fn, dt.datetime.fromtimestamp(st.st_mtime, dateutil.tz.tzutc())
Expand Down

0 comments on commit 95d33db

Please sign in to comment.