Skip to content

Commit

Permalink
Add argument for skipping file scan step
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed Aug 4, 2020
1 parent c3c02b3 commit b5fe8e2
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions bin/g32influx
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,19 @@ class DataLoader:
else:
logging.debug(f"Unpublished file {path} not in file_list, skipping.")

def run(self):
self.check_filelist_against_sqlite()
def run(self, skip_file_check=False):
"""Run file check and upload.
Parameters
----------
skip_file_check : bool
Skip the file check step, proccessing only files already in the
database from a previous scan. Helpful if restarting a run where
you know input files haven't changed.
"""
if not skip_file_check:
self.check_filelist_against_sqlite()
self.publish_all_files_to_influxdb()


Expand Down Expand Up @@ -501,6 +512,8 @@ def main():
help='Set loglevel.')
parser.add_argument('--logfile', '-f', default='g32influx.log',
help='Set the logfile.')
parser.add_argument('--skip-file-check', '-s', action='store_true',
help='Skip file check step.')
# parser.add_argument('--docker', '-d', action='store_true',
# help='Force use of docker, even if so3g is installed.')
args = parser.parse_args()
Expand All @@ -513,7 +526,7 @@ def main():

dl = DataLoader(args.target, args.database, host=args.host, port=args.port,
startdate=args.start, enddate=args.end)
dl.run()
dl.run(args.skip_file_check)


if __name__ == "__main__":
Expand Down

0 comments on commit b5fe8e2

Please sign in to comment.