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

Links: Remove dead links upon entity deletion #446

Conversation

martastain
Copy link
Member

@martastain martastain commented Nov 21, 2024

Changes

Continuous clean-up

Upon project-level entity deletion, all its links should be removed. This is done by calling ayon_server.helpers.entity_links.remove_entity_links function (new)

Deep clean-up

Clean-up procedure for remaining dead links could be done by calling ayon_server.helpers.entity_links.remove_dead_links.
This function is not yet exposed, but will become a part of a maintenance procedure.

Until then, it is possible to do that manually when needed:

  1. Enter the python shell inside the server container: docker compose exec server python
  2. Paste the following snippet and execute the script:
import asyncio

from ayon_server.initialize import ayon_init
from ayon_server.helpers.entity_links import remove_dead_links

async def main():
    await ayon_init()
    await remove_dead_links("My_project")

asyncio.run(main())

@martastain martastain linked an issue Nov 21, 2024 that may be closed by this pull request
@martastain martastain added the type: bug Something isn't working label Nov 21, 2024
@martastain martastain self-assigned this Nov 21, 2024
@martastain martastain marked this pull request as ready for review November 22, 2024 15:02
Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

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

I have tested remove_dead_links function as described for container python script and it was working as expected. All my dead links are gone and GraphQL works now as expected. Thank you!

@martastain martastain merged commit 08a2e29 into develop Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Links: Deleting an entity does not remove associated link
2 participants