Exemplo n.º 1
0
 def update_search(self):
     from website.search.search import update_user
     from website.search.exceptions import SearchUnavailableError
     try:
         update_user(self)
     except SearchUnavailableError as e:
         logger.exception(e)
         log_exception()
Exemplo n.º 2
0
def migrate_users(index):
    logger.info("Migrating users to index: {}".format(index))
    n_migr = 0
    n_iter = 0
    for user in User.find():
        if user.is_active:
            search.update_user(user, index=index)
            n_migr += 1
        n_iter += 1

    logger.info('Users iterated: {0}\nUsers migrated: {1}'.format(n_iter, n_migr))
Exemplo n.º 3
0
def migrate_users(index):
    logger.info("Migrating users to index: {}".format(index))
    n_migr = 0
    n_iter = 0
    for user in User.find():
        if user.is_active:
            search.update_user(user, index=index)
            n_migr += 1
        n_iter += 1

    logger.info('Users iterated: {0}\nUsers migrated: {1}'.format(
        n_iter, n_migr))
Exemplo n.º 4
0
def migrate_users(index):
    logger.info('Migrating users to index: {}'.format(index))
    n_migr = 0
    n_iter = 0
    users = paginated(User, query=None, increment=1000, each=True)
    for user in users:
        if user.is_active:
            search.update_user(user, index=index)
            n_migr += 1
        n_iter += 1

    logger.info('Users iterated: {0}\nUsers migrated: {1}'.format(n_iter, n_migr))
Exemplo n.º 5
0
def migrate_users(index):
    logger.info('Migrating users to index: {}'.format(index))
    n_migr = 0
    n_iter = 0
    users = paginated(User, query=None, each=True)
    for user in users:
        if user.is_active:
            search.update_user(user, index=index)
            n_migr += 1
        n_iter += 1

    logger.info('Users iterated: {0}\nUsers migrated: {1}'.format(
        n_iter, n_migr))
Exemplo n.º 6
0
 def update_search(self):
     from website.search import search
     search.update_user(self)
Exemplo n.º 7
0
 def update_search(self):
     from website.search import search
     search.update_user(self)