<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> import logging <EOL> from datetime import timedelta <EOL> from django . utils import timezone <EOL> from sentry . models import Option <EOL> from sentry . options import default_manager <EOL> from sentry . options . manager import UnknownOption <EOL> from sentry . tasks . base import instrumented_task <EOL> ONE_HOUR = <NUM_LIT> * <NUM_LIT> <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> @ instrumented_task ( name = '<STR_LIT>' , queue = '<STR_LIT>' ) <EOL> def sync_options ( cutoff = ONE_HOUR ) : <EOL> """<STR_LIT>""" <EOL> cutoff_dt = timezone . now ( ) - timedelta ( seconds = cutoff ) <EOL> for option in Option . objects . filter ( last_updated__gte = cutoff_dt ) . iterator ( ) : <EOL> try : <EOL> opt = default_manager . lookup_key ( option . key ) <EOL> default_manager . store . set_cache ( opt , option . value ) <EOL> except UnknownOption as e : <EOL> logger . exception ( unicode ( e ) ) </s>
