remove: last 2 digits of timestamp

This commit is contained in:
kostas 2024-08-12 09:51:04 +02:00
parent 7db44785be
commit 37394bded9
1 changed files with 4 additions and 1 deletions

View File

@ -551,6 +551,7 @@ def create_update_task(modbus, service, batteries):
num_files_in_csv_dir = count_files_in_folder(CSV_DIR) num_files_in_csv_dir = count_files_in_folder(CSV_DIR)
if elapsed_time >= 1200: if elapsed_time >= 1200:
print("CREATE BATCH ======================================>")
create_batch_of_csv_files() create_batch_of_csv_files()
start_time = time.time() start_time = time.time()
@ -648,11 +649,13 @@ def create_batch_of_csv_files():
last_csv_file_name = os.path.basename(recent_csv_files[-1]) if recent_csv_files else first_csv_filename last_csv_file_name = os.path.basename(recent_csv_files[-1]) if recent_csv_files else first_csv_filename
# we send the csv files every 30 seconds and the timestamp is adjusted to be a multiple of 30 # we send the csv files every 30 seconds and the timestamp is adjusted to be a multiple of 30
numeric_part = int(last_csv_file_name.split('.')[0]) numeric_part = int(last_csv_file_name.split('.')[0][:-2])
# compressed_filename = "{}.csv".format(new_numeric_part) # compressed_filename = "{}.csv".format(new_numeric_part)
compressed_filename = "{}.csv".format(numeric_part) compressed_filename = "{}.csv".format(numeric_part)
print("FILE NAME =========================================================> ", compressed_filename)
response = s3_config.create_put_request(compressed_filename, compressed_csv) response = s3_config.create_put_request(compressed_filename, compressed_csv)
# response = s3_config.create_put_request(first_csv_filename, csv_data) # response = s3_config.create_put_request(first_csv_filename, csv_data)
if response.status_code == 200: if response.status_code == 200: