Cleaning unused tenant-tags

#1

To remove all the tags of a tenant, call
Tenant.remove()
To remove one tag of a tenant, call
Tag.remove()
The latter also calls Tag.removeData(), so all together work to prevent leaks.
To see what tenants are, type: Console.init().user.allTenants.

Source: Riley and David T.

0 Likes

Process for deleting unused tags (and associated data)
#2

image

do we know if the parameters are set by default? And to what?

0 Likes

#3

if you don’t provide the parameters, they will be null in the function body and the test if(null) evaluates to false.

0 Likes

#4

I can confirm that some SourceFiles persist after tag.remove & tag.create for the same id. They don’t appear with a SourceFile.fetch, but do appear after a SourceFile.syncAll().

Similarly, some people have reported Metrics were still fetchable on the tag after Tag.remove

0 Likes

#5

In which version do they remain?

0 Likes

#6

Confirmed for 7.8.

I have anecdotal reports this happened on 7.7 as well.

0 Likes

#7

@steveders so SourceFile (type) is correctly emptied, however the actual files aren’t deleted from S3. SourceFile.syncAll() repopulates SourceFile type with file metadata.

1 Like

#8

Just did another test on a 7.8.1 environment.
It does not appear that SimpleMetrics are removed with Tag.removeData(true,true)

It does look like Fixture & SmartBulb instances are.

0 Likes

#9

After calling Tag.remove(“dev2”) and Tag.create(“dev2”), no SimpleMetrics are fetched.

0 Likes