makeasnek/FindTheMag2

Debug message is incorrect in get_approved_project_urls_web()

Closed this issue · 2 comments

The debug message right at the start of the function indicates that the cached results are being returned... before the decision is made to return the cached version or an updated version.

    # Return cached version if we have it and requested it < 24 hrs ago
    log.debug('Returning cached version of gridcoinstats data')
    delta=datetime.datetime.now()-DATABASE.get('LASTGRIDCOINSTATSPROJECTCHECK',datetime.datetime(1993,3,3))
    if abs(delta.days)<1 and 'GSPROJECTLIST' in DATABASE and 'GSRESOLVERDICT' in DATABASE:
        return DATABASE['GSPROJECTLIST'],DATABASE['GSRESOLVERDICT']

The debug message should either be moved down into the if statement (having one there would be a useful thing), or changed to reflect having entered the get_approved_project_urls_web() function.

FYI:
I found this when trying to debug why Universe@home has not been picked up as being back on the whitelist. None of the 12 instances of FTM has picked this up despite Universe being re-whitelisted for the past several days. I have not restarted any of the FTM instances recently.

It would be useful to have a debug message message near the final return in the function indicating that the updated results from the website are being returned. This way you could identify both possible normal outcomes of the function.

FYI: I thought Universe was back on but my mistake. It shows up on the whitelist at gridcoin.us but not gridcoinstats.eu... the first had me fooled. Looks like we have not quite crossed the threshold of no more then 7 out of the last 20 days without credit... 1 or 2 more days to go to meet that criteria.

Debugging messages issue still stands though.

Good eye, fixed! Always check the wallet for the latest greylist/whitelist stuff. Gridcoinstats (as far as FTM is concerned) only updates once every 24 hours. Gridcoin.us doesn't show greylist status at all.