"Fossies" - the Fresh Open Source Software Archive

Member "panko-8.1.0/panko/storage/impl_log.py" (4 Aug 2021, 1080 Bytes) of package /linux/misc/openstack/panko-8.1.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #
    2 # Licensed under the Apache License, Version 2.0 (the "License"); you may
    3 # not use this file except in compliance with the License. You may obtain
    4 # a copy of the License at
    5 #
    6 #      http://www.apache.org/licenses/LICENSE-2.0
    7 #
    8 # Unless required by applicable law or agreed to in writing, software
    9 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   10 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   11 # License for the specific language governing permissions and limitations
   12 # under the License.
   13 
   14 from oslo_log import log
   15 
   16 from panko.storage import base
   17 
   18 LOG = log.getLogger(__name__)
   19 
   20 
   21 class Connection(base.Connection):
   22     """Log event data."""
   23 
   24     @staticmethod
   25     def clear_expired_data(ttl, max_count):
   26         """Clear expired data from the backend storage system.
   27 
   28         Clearing occurs according to the time-to-live.
   29 
   30         :param ttl: Number of seconds to keep records for.
   31         :param max_count: Number of records to delete.
   32         """
   33         LOG.info("Dropping %d events data with TTL %d", max_count, ttl)