Beispiel #1
0
def invalidate_all_caches():
    """
    Basic entry-point for clearing necessary caches.  Most functions can
    call in here.
    """
    invalidate_inmemory_caches()
    if DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP:
        
        # The underlying assumption here is that if generating in memory caches is too onerous a task to conduct
        # at every system start up, then it is too onerous a task to conduct during server operation.
        # We defer the regeneration of these caches to next system startup, by deleting the existing disk based
        # copies of these caches.
        # This will prompt the caches to be recreated at next system start up, and the disk based copies to be rewritten.
        
        for filename in glob.glob(os.path.join(settings.CHANNEL_DATA_PATH, "*.cache")):
            os.remove(filename)
    else:
        initialize_content_caches(force=True)
    if caching_is_enabled():
        invalidate_web_cache()
    logging.debug("Great success emptying all caches.")
Beispiel #2
0
def invalidate_all_caches():
    """
    Basic entry-point for clearing necessary caches.  Most functions can
    call in here.
    """
    invalidate_inmemory_caches()
    if DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP:
        
        # The underlying assumption here is that if generating in memory caches is too onerous a task to conduct
        # at every system start up, then it is too onerous a task to conduct during server operation.
        # We defer the regeneration of these caches to next system startup, by deleting the existing disk based
        # copies of these caches.
        # This will prompt the caches to be recreated at next system start up, and the disk based copies to be rewritten.

        for filename in glob.glob(os.path.join(CHANNEL_DATA_PATH, "*.cache")) + [CONTENT_CACHE_FILEPATH]:
            os.remove(filename)
    elif sys.platform != 'darwin':
        # Macs have to run video download in a subprocess, and as this is only ever called during runtime from
        # video download or the videoscan subprocess, this never actually affects variables in the main KA Lite thread.
        initialize_content_caches(force=True)
    if caching_is_enabled():
        invalidate_web_cache()
    logging.debug("Great success emptying all caches.")
Beispiel #3
0
def invalidate_all_caches():
    """
    Basic entry-point for clearing necessary caches.  Most functions can
    call in here.
    """
    invalidate_inmemory_caches()
    if DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP:

        # The underlying assumption here is that if generating in memory caches is too onerous a task to conduct
        # at every system start up, then it is too onerous a task to conduct during server operation.
        # We defer the regeneration of these caches to next system startup, by deleting the existing disk based
        # copies of these caches.
        # This will prompt the caches to be recreated at next system start up, and the disk based copies to be rewritten.

        for filename in glob.glob(os.path.join(
                CHANNEL_DATA_PATH, "*.cache")) + [CONTENT_CACHE_FILEPATH]:
            os.remove(filename)
    elif sys.platform != 'darwin':
        # Macs have to run video download in a subprocess, and as this is only ever called during runtime from
        # video download or the videoscan subprocess, this never actually affects variables in the main KA Lite thread.
        initialize_content_caches(force=True)
    if caching_is_enabled():
        invalidate_web_cache()
    logging.debug("Great success emptying all caches.")