|
|
@ -66,13 +66,19 @@ def auto_check_ios_developer_active(): |
|
|
|
for ios_developer in all_ios_developer: |
|
|
|
for ios_developer in all_ios_developer: |
|
|
|
userinfo = ios_developer.user_id |
|
|
|
userinfo = ios_developer.user_id |
|
|
|
if userinfo.supersign_active: |
|
|
|
if userinfo.supersign_active: |
|
|
|
status, result = IosUtils.active_developer(ios_developer) |
|
|
|
count = 3 |
|
|
|
msg = f"auto_check_ios_developer_active user:{userinfo} ios.developer:{ios_developer} status:{status} result:{result}" |
|
|
|
while count > 0: |
|
|
|
if status: |
|
|
|
status, result = IosUtils.active_developer(ios_developer) |
|
|
|
logger.info(msg) |
|
|
|
msg = f"auto_check_ios_developer_active user:{userinfo} ios.developer:{ios_developer} status:{status} result:{result}" |
|
|
|
else: |
|
|
|
if status: |
|
|
|
ios_developer.is_actived = False |
|
|
|
logger.info(msg) |
|
|
|
ios_developer.save() |
|
|
|
break |
|
|
|
logger.error(msg) |
|
|
|
else: |
|
|
|
send_ios_developer_active_status(userinfo, MSGTEMPLATE.get('AUTO_CHECK_DEVELOPER') % ( |
|
|
|
count -= 1 |
|
|
|
userinfo.first_name, ios_developer.name)) |
|
|
|
time.sleep(5) |
|
|
|
|
|
|
|
if count == 0: |
|
|
|
|
|
|
|
ios_developer.is_actived = False |
|
|
|
|
|
|
|
ios_developer.save(update_fields=['is_actived']) |
|
|
|
|
|
|
|
logger.error(msg) |
|
|
|
|
|
|
|
send_ios_developer_active_status(userinfo, MSGTEMPLATE.get('AUTO_CHECK_DEVELOPER') % ( |
|
|
|
|
|
|
|
userinfo.first_name, ios_developer.name)) |
|
|
|