seatgeek / backstage-plugins

SeatGeek Backstage Plugins Collection
Apache License 2.0
34 stars 6 forks source link

slack-catalog cache TTL #47

Open crivetechie opened 8 months ago

crivetechie commented 8 months ago

Hi! Thanks for creating this set of plugins! I am looking at using slack-catalog, it works great however it doesn't seem to have a TTL on the cache, I think it would be great if you could add a TTL config parameter so that new slack members can be loaded.

zhammer commented 8 months ago

this'd be great! it also may make sense to use Backstage's proper caching solution here.

would appreciate a PR on this one. our slack org doesn't change too often so this isn't high prio for us

crivetechie commented 8 months ago

I think I can take a look, do you have a reference I can take a look at to see how to implement Backstage caching? Thanks!

zhammer commented 8 months ago

on a quick look i find this: https://backstage.io/docs/reference/backend-plugin-api.cacheservice/

although in the slack catalog case, the "cache" isn't really a proper cache, it's just there so there can be one user list call to the slack api rather than getting each user individually. this makes sense for us because users come only from our okta provider on a schedule, so every 24hr we'll get an influx of new users all getting processed at once. so in our case just dropping that cache even after a few minutes from it being loaded would be fine (once all the okta ingested users are processed).

how does your org ingest users?

crivetechie commented 8 months ago

Yeah it makes sense to cache that way, we just need to expire it. We ingest users using the GitHub Org Provider.