riverqueue / river

Fast and reliable background jobs in Go
https://riverqueue.com
Mozilla Public License 2.0
3.34k stars 89 forks source link

Simplify names of base service types involving generics for logging #518

Closed brandur closed 1 month ago

brandur commented 1 month ago

A small improvement to base service so that when it's using reflect to get a name of the service's type for logging purposes, it strips a long path out of a generic type for a more succinct result.

So this long, unsightly blemish:

QueryCacher[[]*github.com/riverqueue/riverui/internal/dbsqlc.JobCountByStateRow]

Would become this, which is quite a bit more tolerable:

QueryCacher[[]*dbsqlc.JobCountByStateRow]
brandur commented 1 month ago

thx.