code: def get_data(service, cache_data, trigger_id):
          
          if service.startswith('th_'):
              cache = caches['django_th']
  
              limit = settings.DJANGO_TH.get('publishing_limit', 0)
  
              # publishing of all the data
              if limit == 0:
                  return cache_data
              # or just a set of them
              if cache_data is not None and len(cache_data) > limit:
                  for data in cache_data[limit:]:
                      service_str = ''.join((service, '_', str(trigger_id)))
                      # put that data in a version 2 of the cache
                      cache.set(service_str, data, version=2)
                      # delete data from cache version=1
                      # https://niwinz.github.io/django-redis/latest/#_scan_delete_keys_in_bulk
                      cache.delete_pattern(service_str)
                  # put in cache unpublished data
                  cache_data = cache_data[:limit]
          return cache_data
docs: get the data from the cache
              :param service: the service name
              :param cache_data: the data from the cache
              :type trigger_id: integer
              :return: Return the data from the cache
              :rtype: object