-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check release date in AutoFreezer #175
Check release date in AutoFreezer #175
Conversation
netkan/netkan/metadata.py
Outdated
try: | ||
dct[k] = dateutil.parser.isoparse(dct[k]) | ||
except: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a pretty broad catch, probably ok here, but can lead to hiding errors we didn't expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's intentional. Don't want the whole thing to come to a screeching halt because there's some problem parsing a date string. If that happens, it'll just leave the string in the dict, which is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Waiting on KSP-CKAN/CKAN#3059, which is waiting on KSP-SpaceDock/SpaceDock#265 to go live in production (currently merged to alpha). EDIT: KSP-SpaceDock/SpaceDock#265 is live in beta, expected to go to prod soon-ish. |
a388d93
to
c0b3b23
Compare
Those PRs are now merged, so we're about to have a big wave of ... so far so good. Going to merge all the staged mods first. |
c0b3b23
to
5546c12
Compare
Problems
The AutoFreezer from #96 has itself been in cryofreeze due to mass-update changes:
It uses
ModStatus.last_indexed
to detect idle mods, so anytime we re-index a mod due to a change in how we generate metadata, we effectively fool the AutoFreezer into thinking that the mod was just updated. In reality we should be checking when the most recent release came out.Background
After KSP-CKAN/CKAN#3059, we will be capturing mods' release dates in metadata. They will pass through the Indexer on their way to CKAN-meta.
Changes
Ckan
parsesrelease_date
into adatetime
objectModStatus
has arelease_date
propertyCkan.release_date
intoModStatus.release_date
_too_old
check looks atrelease_date
if it's defined and falls back tolast_indexed
otherwiseThis way we will be able to detect idle mods again.