sync

Backup service to store encrypted wallet databases (experimental)
Log | Files | Refs | Submodules | README | LICENSE

syncdb_gc.c (1737B)


      1 /*
      2   This file is part of TALER
      3   (C) 2014--2022 Taler Systems SA
      4 
      5   TALER is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU Lesser General Public License as published by the Free Software
      7   Foundation; either version 3, or (at your option) any later version.
      8 
      9   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 
     13   You should have received a copy of the GNU General Public License along with
     14   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 */
     16 /**
     17  * @file syncdb/syncdb_gc.c
     18  * @brief garbage collection for sync database
     19  * @author Christian Grothoff
     20  */
     21 #include "syncdb_pg.h"
     22 
     23 
     24 enum GNUNET_GenericReturnValue
     25 SYNCDB_gc (struct GNUNET_TIME_Absolute expire_backups,
     26            struct GNUNET_TIME_Absolute expire_pending_payments,
     27            struct GNUNET_TIME_Absolute expire_objects)
     28 {
     29   struct GNUNET_PQ_QueryParam params[] = {
     30     GNUNET_PQ_query_param_absolute_time (&expire_backups),
     31     GNUNET_PQ_query_param_absolute_time (&expire_pending_payments),
     32     GNUNET_PQ_query_param_absolute_time (&expire_objects),
     33     GNUNET_PQ_query_param_end
     34   };
     35 
     36   if (GNUNET_OK !=
     37       GNUNET_PQ_prepare_anon (
     38         pg->conn,
     39         "CALL sync.sync_do_gc ($1, $2, $3);"))
     40   {
     41     GNUNET_break (0);
     42     return GNUNET_SYSERR;
     43   }
     44   if (0 > GNUNET_PQ_eval_prepared_non_select (pg->conn,
     45                                               "",
     46                                               params))
     47   {
     48     GNUNET_break (0);
     49     return GNUNET_SYSERR;
     50   }
     51   return GNUNET_OK;
     52 }
     53 
     54 
     55 /* end of syncdb_gc.c */