Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
We have a thing template that is used as the base template for 30k devices. We just had to make a change to one of the thing shapes that is applied to that template and that shape is part of an external extension. I can validate the extension in Composer in a matter of a few seconds. However, when I try to officially import the extension it will fail after 10-15 minutes with no specific error in the application log. My suspicion is that this is a thundering herd issue with all of those things attempting to be restarted simultaneously.
Is there a way to stop the devices, perform the extension import, then throttle the starting of those things in batches?
Solved! Go to Solution.
Hello,
You could probably write a service that goes through all of your entities and disables them before doing the opposite and enabling them using these thing services:
But to be completely honest, I'm not entirely sure if this counts as "turning off" or if it is just in a disabled mode somehow.
Here is some documentation regarding this function.
Even if it doesn't turn it off, perhaps it won't do a restart automatically from the change of the shape so that you can do a controlled restart later on.
Regards,
Jens
Hello,
You could probably write a service that goes through all of your entities and disables them before doing the opposite and enabling them using these thing services:
But to be completely honest, I'm not entirely sure if this counts as "turning off" or if it is just in a disabled mode somehow.
Here is some documentation regarding this function.
Even if it doesn't turn it off, perhaps it won't do a restart automatically from the change of the shape so that you can do a controlled restart later on.
Regards,
Jens
Jens,
Thank you for the suggestion and this actually works. I initially wrote this as a single ThingWorx service but that needed to be run multiple times due to the script timeout so I am going to refactor a bit possibly invoking via an external microservice. I will also need the reciprocal EnableThing and/or RestartThing to get them going after the update.
-Matt
Hello,
If you are okay with doing something async, you could also use the subscription function if the code times out.
Just having a looping service sending your thing name into a property and triggering subscription on the value change.
Or you could possibly use an async service, however I have never tried them myself so not exactly sure if they work something like async/await or not.
But glad my suggestion could help you!
Regards,
Jens