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

Some tiny fixes for ME scripts #361

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Conversation

KateSakharova
Copy link
Contributor

@KateSakharova KateSakharova commented Jun 6, 2024

  • Add check for missing records in DB (by some reason?)
  • Add retries for add_analysis function in case of error 500

@KateSakharova KateSakharova self-assigned this Jun 6, 2024
@KateSakharova KateSakharova changed the title Add check for missing records in DB (by some reason?) Some tiny fixes for ME scripts Jun 6, 2024
Copy link
Member

@mberacochea mberacochea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me :)

Copy link
Member

@SandyRogers SandyRogers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KateSakharova
Left one little question where I don't quite understand the flow but happy to merge anyway

Comment on lines +181 to +188
else:
logging.info(
f"Metadata is correct but {annotation_job} is missing in DB. Adding."
)
annotation_job.mgx_accession = registry_id
annotation_job.last_mgx_indexed = (
timezone.now() + timedelta(minutes=1)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't quite get my head around when this would/should happen – Perhaps if we needed to restore our DB from a snapshot backup or something? Or if we ran the script from two disconnected EMG environments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that might happen when I tested ENA PROD API and added record there via CURL post. DB left without update ( ideally I should remove that record and do with emgapi again).
But !
To be honest, I did that only with 2 assemblies but that piece of code was launched more than 2 times during AtlantECO population. So the proper answer hasn't come to my head yet ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeh - that makes sense. Thanks!

@KateSakharova KateSakharova merged commit 069f04d into develop Jun 10, 2024
4 checks passed
@KateSakharova KateSakharova deleted the fix/me-missing-analysis branch June 10, 2024 09:53
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

Successfully merging this pull request may close these issues.

3 participants