/* * SPDX-FileCopyrightText: 2023 Helmut Pozimski * * SPDX-License-Identifier: GPL-2.0-only */ #include #include #include #include "storage.h" #include "ds3231.h" #define SECONDS_PER_DAY 86400 #define TAG "cleanup-task" void cleanup_task(void *pvParameters) { char* namespace = (char*) pvParameters; struct tm current_time; while (1) { ESP_LOGI(TAG, "Executing database cleanup"); ds3231_read_date_time(¤t_time); delete_outdated_entries(¤t_time, namespace); vTaskDelay(SECONDS_PER_DAY * 1000 / portTICK_PERIOD_MS); } vTaskDelete( NULL ); }