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

.close is called for the second time without any error #3246

Open
xSAVIKx opened this issue Dec 12, 2024 · 0 comments
Open

.close is called for the second time without any error #3246

xSAVIKx opened this issue Dec 12, 2024 · 0 comments
Labels

Comments

@xSAVIKx
Copy link

xSAVIKx commented Dec 12, 2024

Describe the bug
If you use the streamer with the following example:

    with importer.ImportStreamer() as streamer:
        streamer.set_sketch(sketch)
        streamer.set_timeline_name(timeline_name)
        streamer.add_file(path)

        streamer.close()  # <-- this uploads the data

the data is going to be uploaded twice. Cause in the close there's no check if the streamer was previously closed or not.

To Reproduce
Steps to reproduce the behavior:

  1. Run the provided example
  2. See that events are duplicated

Expected behavior
An error is raised if the importer was already closed.

Additional context
I get that this may be the desired behavior but I saw a line somewhere about calling .close and added it and then only noticed duplicated data. IMO failing (or doing nothing) in such a situation is a better practice. That's how other closable classes usually behave

@xSAVIKx xSAVIKx added the Bug label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant