-
Notifications
You must be signed in to change notification settings - Fork 9
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
Empty blacklist entries block script #26
Comments
Erratum, my fix is not good.
|
Ok, the problem was how i used the function. |
You can use parameters to customize websocket results: In this example, the method will return after 10 seconds of inactivity during record reception (or if blacklist entries is empty)
Tell me if that could solve your problem. Thomas |
Hello Thomas, Thank you for your help. Regards, Chris. |
Hello,
I'm working on a script to add/remove blacklist automatically.
To optimize my API calls, I get the list of current blacklist.
But if the blacklist entries is empty, my script is stuck.
How to reproduce
The blacklist entries need to be empty.
You will be stuck at the statement
query.fetch_as_element()
Where is the problem
If you call
query.fetch_as_element()
, you will call the method inside smc_monitoring/monitors/blacklist.pyExtract:
The problem in inside the method
fetch_raw
from smc_monitoring/models/query.pyExtract:
if
records
is not inresult
, you will never reach the 'yield' statement and block here.You will need to change the function with something like :
Or maybe there is something I don't understant an how works the API.
Thanks in advance.
Regards, Chris.
The text was updated successfully, but these errors were encountered: