1
0
This repository has been archived on 2024-02-27. You can view files and clone it, but cannot push or open issues or pull requests.
chatgpt-to-api/internal/bard/request.go

22 lines
262 B
Go
Raw Normal View History

2023-06-12 15:56:58 +00:00
package bard
2023-06-12 16:17:56 +00:00
import "time"
type BardCache struct {
2023-06-12 16:36:54 +00:00
Bards map[string]*Bard
2023-06-12 16:17:56 +00:00
}
var cache *BardCache
func init() {
cache = &BardCache{
2023-06-12 16:36:54 +00:00
Bards: make(map[string]*Bard),
2023-06-12 16:17:56 +00:00
}
go func() {
for {
GarbageCollectCache(cache)
time.Sleep(time.Minute)
}
}()
}