mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Add instance-stats-randomize
config option (#3718)
* [feature] Add `instance-stats-randomize` config option * don't use cache (overkill)
This commit is contained in:
@ -1745,6 +1745,12 @@ func (c *Converter) InstanceToAPIV1Instance(ctx context.Context, i *gtsmodel.Ins
|
||||
stats["domain_count"] = util.Ptr(domainCount)
|
||||
instance.Stats = stats
|
||||
|
||||
if config.GetInstanceStatsRandomize() {
|
||||
// Whack some random stats on the instance
|
||||
// to be injected by API handlers.
|
||||
instance.RandomStats = c.RandomStats()
|
||||
}
|
||||
|
||||
// thumbnail
|
||||
iAccount, err := c.state.DB.GetInstanceAccount(ctx, "")
|
||||
if err != nil {
|
||||
@ -1821,6 +1827,12 @@ func (c *Converter) InstanceToAPIV2Instance(ctx context.Context, i *gtsmodel.Ins
|
||||
instance.Debug = util.Ptr(true)
|
||||
}
|
||||
|
||||
if config.GetInstanceStatsRandomize() {
|
||||
// Whack some random stats on the instance
|
||||
// to be injected by API handlers.
|
||||
instance.RandomStats = c.RandomStats()
|
||||
}
|
||||
|
||||
// thumbnail
|
||||
thumbnail := apimodel.InstanceV2Thumbnail{}
|
||||
|
||||
|
Reference in New Issue
Block a user