def main():
    def workhorse():
        AccountActivationReminderEmails().execute_batch()

    while True:
        job_runner(workhorse)

        if settings.TEST:
            # just make sure that it runs
            break

        if not DAEMON_MODE:
            # just run once, don't keep looping
            break

        slog('Done sending reminder emails, sleeping...')
        time.sleep(TIMEOUT_1_HOUR)
Beispiel #2
0
def main():
    def workhorse():
        AccountActivationReminderEmails().execute_batch()

    while True:
        job_runner(workhorse)

        if settings.TEST:
            # just make sure that it runs
            break

        if not DAEMON_MODE:
            # just run once, don't keep looping
            break

        slog('Done sending reminder emails, sleeping...')
        time.sleep(TIMEOUT_1_HOUR)
"""
Update the StaticAssetVersionCache value

This script is invoked after a deploy, to ensure that visitors to the website won't have stale versions of CSS and JavaScript files in their browser cache
"""
import script_config

from htk.utils import utcnow
from htk.cachekeys import StaticAssetVersionCache
from htk.scripts.utils import job_runner
from htk.scripts.utils import slog

def main():
    # use date as asset_version because it is unique at the time of deploy
    now = utcnow()
    asset_version = now.strftime('%Y%m%d%H%M%S')
    slog('New asset version: %s' % asset_version)
    c = StaticAssetVersionCache()
    c.cache_store(asset_version)

if __name__ == '__main__':
    job_runner(main)
Beispiel #4
0
"""
Update the StaticAssetVersionCache value

This script is invoked after a deploy, to ensure that visitors to the website won't have stale versions of CSS and JavaScript files in their browser cache
"""
# Standalone Script Prerequisite Imports
import script_config

# HTK Imports
from htk.cachekeys import StaticAssetVersionCache
from htk.scripts.utils import job_runner
from htk.scripts.utils import slog
from htk.utils import utcnow


def main():
    # use date as asset_version because it is unique at the time of deploy
    now = utcnow()
    asset_version = now.strftime('%Y%m%d%H%M%S')
    slog('New asset version: %s' % asset_version)
    c = StaticAssetVersionCache()
    c.cache_store(asset_version)


if __name__ == '__main__':
    job_runner(main)