Skip to content
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

Instructions for "Updating activities after changing import code" in readme don't work #297

Open
odscjames opened this issue Oct 5, 2021 · 1 comment
Assignees

Comments

@odscjames
Copy link
Collaborator

Describe the bug

While working on #296 I followed the instructions in the readme "Updating activities after changing import code" and they don't work

To Reproduce

  • Check out my branch
  • Follow instructions
  • Wait
  • On DB run
    select count(*) from activity where raw_json is null;
    select count(*) from activity where raw_json is not null;

The first one will be a non-zero number

Expected behaviour

"select count(*) from activity where raw_json is null;" will say 0

Screenshots

n/a

Additional context

n/a

ps. It is possible something in my changes to the import code is not right ....

@andylolz
Copy link
Member

andylolz commented Oct 5, 2021

Okay so I think the problem here is that I updated the crawler code, but failed to update the related docs 😬 Sorry about that.

it looks like that bit of the README was written 7 years ago (!) Rolling back to then, it was certainly correct – if last_succ was None, the dataset would be queued for parsing:

need_update = [r for r in dataset.resources
if not r.last_succ or r.last_succ < dataset.last_modified]
for resource in need_update:
rq.enqueue(update_resource, args=(resource.url,), result_ttl=0)

However, it’s definitely not true now. I think there are now two options: You can either run UPDATE resource SET last_parsed = NULL;, or alternatively, trigger an import with:

iati crawler download-and-update --ignore-hashes

ignore-hashes should parse everything regardless of whether the hashed data appears unchanged.

I’ve updated the README accordingly in 79fcb30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants