mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
Invocation of separate threa in get_idp_data() problem resolved
This commit is contained in:
parent
cd3535dcd2
commit
894756ad96
@ -34,20 +34,18 @@ class SAML(object):
|
||||
'SAML: IDP Metadata initial load failed')
|
||||
exit(-1)
|
||||
|
||||
|
||||
def get_idp_data(self):
|
||||
|
||||
### Currently commented out while throwing exception,
|
||||
### will take a look soon
|
||||
# lifetime = timedelta(
|
||||
# minutes=current_app.config['SAML_METADATA_CACHE_LIFETIME'])
|
||||
# if self.idp_timestamp + lifetime < datetime.now():
|
||||
# background_thread = Thread(target=self.retrieve_idp_data)
|
||||
# background_thread.start()
|
||||
lifetime = timedelta(minutes=current_app.config['SAML_METADATA_CACHE_LIFETIME'])
|
||||
|
||||
if self.idp_timestamp + lifetime < datetime.now():
|
||||
background_thread = Thread(target=self.retrieve_idp_data())
|
||||
background_thread.start()
|
||||
|
||||
self.retrieve_idp_data()
|
||||
return self.idp_data
|
||||
|
||||
|
||||
def retrieve_idp_data(self):
|
||||
|
||||
if 'SAML_IDP_SSO_BINDING' in current_app.config:
|
||||
@ -162,4 +160,4 @@ class SAML(object):
|
||||
settings['organization']['en-US']['name'] = 'PowerDNS-Admin'
|
||||
settings['organization']['en-US']['url'] = own_url
|
||||
auth = self.OneLogin_Saml2_Auth(req, settings)
|
||||
return auth
|
||||
return auth
|
||||
|
Loading…
Reference in New Issue
Block a user