Hi team, Reposting as I didn't get any response on...
# ask-community
a
Hi team, Reposting as I didn't get any response on the original thread. Anyone has thoughts on how we can fix this?
j
Hey @Arun Kumar there might be a better way to do this, but one option is to write a script that lists all of the sensors using
dagster sensor list
and then stops each sensor with
dagster sensor stop [sensor_name]
a
Thanks Jamie. How can we identify the sensors that are unloaded? Is there any field in graphQL API that we can use to differentiate?
d
something like this could work:
Copy code
query UnloadableSensorsQuery {
    unloadableInstigationStatesOrError(instigationType: SENSOR) {
      ... on InstigationStates {
        results {
          id
         .name
          repositoryName
          repositoryLocationNAme
        }
      }
a
Thanks @daniel. Are there any ways we can make the sensor turn off automatically when it is not available in the code location? Or the only way is to stop the unloadable sensors periodically using the above graphQL query?
d
I think if you set to be automatically running in code then it should go away automatically when it’s no longer in code
a
Ah ok. Let me try that. Thanks 🙏