예제 #1
0
        def sync_collection(connection, transaction):
            """ Sync newly added. """
            where = BIClubWPTUser.__table__.c.orig_user_id == bindparam(
                '_orig_user_id')
            values = {
                'exchanged_at': bindparam('exchanged_at'),
                'exchanged_user_id': bindparam('exchanged_user_id')
            }

            try:
                connection.execute(
                    BIClubWPTUser.__table__.update().where(where).values(
                        values), rows)
                set_config_value(connection,
                                 'last_imported_clubwpt_user_update_time',
                                 new_config_value)
            except:
                print(
                    'process_clubwpt_user_newly_updated_records transaction.rollback()'
                )
                transaction.rollback()
                raise
            else:
                print(
                    'process_clubwpt_user_newly_updated_records transaction.commit()'
                )
                transaction.commit()
            return
예제 #2
0
 def sync_collection(connection, transaction):
     """ Sync newly added. """
     try:
         connection.execute(BIUserCurrency.__table__.insert(), rows)
         set_config_value(connection,
                          'last_imported_user_gold_currency_add_time',
                          new_config_value)
     except:
         print(
             'process_user_gold_currency_newly_added_records transaction.rollback()'
         )
         transaction.rollback()
         raise
     else:
         print(
             'process_user_gold_currency_newly_added_records transaction.commit()'
         )
         transaction.commit()
     return
예제 #3
0
 def sync_collection(connection, transaction):
     """ Sync newly added. """
     try:
         connection.execute(BIClubWPTUser.__table__.insert(), rows)
         set_config_value(
             connection, 'last_imported_clubwpt_user_add_time',
             current_time().format('YYYY-MM-DD HH:mm:ss'))
     except:
         print(
             'process_clubwpt_user_newly_added_records transaction.rollback()'
         )
         transaction.rollback()
         raise
     else:
         print(
             'process_clubwpt_user_newly_added_records transaction.commit()'
         )
         transaction.commit()
     return
예제 #4
0
        def sync_collection(connection, transaction):
            """ Sync newly added. """
            where = BIUser.__table__.c.user_id == bindparam('_user_id')
            values = {
                'dollar_paid_count': bindparam('dollar_paid_count'),
                'dollar_paid_amount': bindparam('dollar_paid_amount'),
            }

            try:
                connection.execute(
                    BIUser.__table__.update().where(where).values(values),
                    rows)
                set_config_value(
                    connection, 'last_imported_user_bill_dollar_paid_add_time',
                    new_config_value)
            except:
                print('process_user_dollar_paid_total transaction.rollback()')
                transaction.rollback()
                raise
            else:
                print('process_user_dollar_paid_total transaction.commit()')
                transaction.commit()
            return