Skip to content
Snippets Groups Projects
Commit 0f0a8a1a authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Refactor the function: unpack_bundle()

1. When a 0-length bundle file was encountered or an unpacking error occurred,
   any remaining bundles for the current search day-of-week (e.g. *.SU*) would
   be skipped/ignored. This bug (issue #764, regarding the 0-length file part),
   is fixed by not incrementing the day-of-week index in the main loop, but
   rather only incremeting the index when all bundles for the current
   day-of-week have been processed.
2. The age calculation for 0-byte/length bundle files was incorrect, so all
   0-length  bundle files would always be considered "less than 24-hours old"
   (and thus, never auto-deleted).
   This exacerbated the problem of issue #764 since it would persist until the
   0-length files were manually deleted. Fixed the file age calculation and
   now logging the date/timestamp of the 0-length file as well.
3. Don't do the switch/case/sprintf dance when we're not re-running a glob()
   search.
4. Replace the switch/case statement with an array of week day names/patterns.
5. Ignore (with a warning log message) any sub-directories of the inbound
   directory that happen to match the bundle file search pattern.
6. Use better variable naming.
7. Refer to files with a length of 0 as "0-length" instead of "0-byte" in log
   messages.
parent 3a45c021
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment