Beispiel #1
0
    def handle(self, *args, **options):
        pending_fulfillments = BountyFulfillment.objects.filter(
            payout_status='pending')

        # Extensions
        ext_payout_types = [
            'web3_modal', 'polkadot_ext', 'harmony_ext', 'binance_ext',
            'rsk_ext'
        ]
        for ext_payout_type in ext_payout_types:
            ext_pending_fulfillments = pending_fulfillments.filter(
                payout_type=ext_payout_type)
            for fulfillment in ext_pending_fulfillments.all():
                sync_payout(fulfillment)

        # QR
        qr_pending_fulfillments = pending_fulfillments.filter(payout_type='qr')
        if qr_pending_fulfillments:
            # Auto expire pending transactions
            timeout_period = timezone.now() - timedelta(minutes=20)
            qr_pending_fulfillments.filter(
                modified_on__lt=timeout_period).update(payout_status='expired')

            fulfillments = qr_pending_fulfillments.filter(
                payout_status='pending')
            for fulfillment in fulfillments.all():
                sync_payout(fulfillment)
Beispiel #2
0
    def handle(self, *args, **options):
        pending_fulfillments = BountyFulfillment.objects.filter(
            payout_status='pending')

        timeout_period = timezone.now() - timedelta(minutes=6)

        pending_fulfillments.filter(created_on__lt=timeout_period).update(
            payout_status='expired')

        fulfillments = pending_fulfillments.filter(payout_status='pending')

        for fulfillment in fulfillments.all():
            sync_payout(fulfillment)
Beispiel #3
0
    def handle(self, *args, **options):
        pending_fulfillments = BountyFulfillment.objects.filter(
            payout_status='pending')

        # web3 modal
        web3_modal_pending_fulfillments = pending_fulfillments.filter(
            payout_type='web3_modal')
        if web3_modal_pending_fulfillments:
            for fulfillment in web3_modal_pending_fulfillments.all():
                sync_payout(fulfillment)

        # polkadot extension
        polkadot_pending_fulfillments = pending_fulfillments.filter(
            payout_type='polkadot_ext')
        if polkadot_pending_fulfillments:
            for fulfillment in polkadot_pending_fulfillments.all():
                sync_payout(fulfillment)

        # binance extension
        binance_pending_fulfillments = pending_fulfillments.filter(
            payout_type='binance_ext')
        if binance_pending_fulfillments:
            for fulfillment in binance_pending_fulfillments.all():
                sync_payout(fulfillment)

        # harmony extension
        harmony_pending_fulfillments = pending_fulfillments.filter(
            payout_type='harmony_ext')
        if harmony_pending_fulfillments:
            for fulfillment in harmony_pending_fulfillments.all():
                sync_payout(fulfillment)

        # QR
        qr_pending_fulfillments = pending_fulfillments.filter(payout_type='qr')
        if qr_pending_fulfillments:
            # Auto expire pending transactions
            timeout_period = timezone.now() - timedelta(minutes=20)
            qr_pending_fulfillments.filter(
                created_on__lt=timeout_period).update(payout_status='expired')

            fulfillments = qr_pending_fulfillments.filter(
                payout_status='pending')
            for fulfillment in fulfillments.all():
                sync_payout(fulfillment)
Beispiel #4
0
    def handle(self, *args, **options):
        pending_fulfillments = BountyFulfillment.objects.filter(
            payout_status='pending')

        web3_modal_pending_fulfillments = pending_fulfillments.filter(
            payout_type='web3_modal')
        if web3_modal_pending_fulfillments:
            for fulfillment in web3_modal_pending_fulfillments.all():
                sync_payout(fulfillment)

        qr_pending_fulfillments = pending_fulfillments.filter(payout_type='qr')
        if qr_pending_fulfillments:
            # Auto expire pending transactions
            timeout_period = timezone.now() - timedelta(minutes=20)
            qr_pending_fulfillments.filter(
                created_on__lt=timeout_period).update(payout_status='expired')

            fulfillments = qr_pending_fulfillments.filter(
                payout_status='pending')
            for fulfillment in fulfillments.all():
                sync_payout(fulfillment)