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

fix: when running multiple instances, ORM metadata cause crash #79

Open
pekasen opened this issue Jul 13, 2023 · 1 comment
Open

fix: when running multiple instances, ORM metadata cause crash #79

pekasen opened this issue Jul 13, 2023 · 1 comment
Assignees

Comments

@pekasen
Copy link
Member

pekasen commented Jul 13, 2023

InvalidRequestError: Table 'node' is already defined for this MetaData instance.  Specify 'extend_existing=True' to redefine options and columns on an existing Table object.

The Metadate object should be insulated and used only one instance.

@pekasen pekasen self-assigned this Jul 13, 2023
@pekasen
Copy link
Member Author

pekasen commented Jul 13, 2023

This is caused by the ORM-classes being defined on the module level, i.e. the objects for all Spider-instances inherit from the same base-class, thus, re-using table names is disallowd.

Solution would be to wrap the DB-handling inside a class.

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

When branches are created from issues, their pull requests are automatically linked.

1 participant