def init_props(config): from webrecorder.models import User, Collection, Recording, Stats User.init_props(config) Collection.init_props(config) Recording.init_props(config) Stats.init_props(config) import webrecorder.rec.storage.storagepaths as storagepaths storagepaths.init_props(config)
def init_props(config): from webrecorder.models import User, Collection, Recording, Stats, Auto User.init_props(config) Collection.init_props(config) Recording.init_props(config) Stats.init_props(config) Auto.init_props(config) import webrecorder.rec.storage.storagepaths as storagepaths storagepaths.init_props(config)
def delete_expired_external(self): """ Delete any expired external collections in non-temp users """ all_ext_templ = Collection.EXTERNAL_KEY.format(coll='*') for ext_key in self.data_redis.scan_iter(all_ext_templ): try: _, coll, _2 = ext_key.split(':', 2) collection = Collection(my_id=coll, redis=self.data_redis, access=BaseAccess()) user = collection.get_owner() if not user or user.is_anon(): continue if not collection.has_cdxj(): logger.debug( 'TempChecker: Delete Expired External Coll: ' + collection.name) user.remove_collection(collection, delete=True) except Exception: import traceback traceback.print_exc()