Clean phone index reply

This commit is contained in:
nolash 2021-04-07 15:44:50 +02:00
parent 7fad15b66d
commit 49e92874c3
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -3,6 +3,7 @@ import logging
import urllib.parse import urllib.parse
import urllib.error import urllib.error
import urllib.request import urllib.request
import json
# external imports # external imports
import celery import celery
@ -23,7 +24,8 @@ class MetadataTask(celery.Task):
urllib.error.HTTPError, urllib.error.HTTPError,
) )
retry_kwargs = { retry_kwargs = {
'countdown': 1, 'countdown': 3,
'max_retries': 100,
} }
@classmethod @classmethod
@ -40,4 +42,11 @@ def resolve_phone(self, phone):
url = urllib.parse.urljoin(self.meta_url(), identifier) url = urllib.parse.urljoin(self.meta_url(), identifier)
logg.debug('attempt getting phone pointer at {}'.format(url)) logg.debug('attempt getting phone pointer at {}'.format(url))
r = urllib.request.urlopen(url) r = urllib.request.urlopen(url)
logg.debug('phone pointer result {}'.format(r)) address = json.load(r)
logg.debug('address {} for phone {}'.format(address, phone))
@celery_app.task(bind=True, base=MetadataTask)
def transfer_opening_balance(self, phone, address):
pass