Clean phone index reply
This commit is contained in:
parent
7fad15b66d
commit
49e92874c3
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user