mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-10-03 23:54:06 +00:00
feat(auto): quota-aware AUTO slot scheduling (model tiers, hour/week/month resets) + key scope periods; fix key/slot create/delete UX
This commit is contained in:
@ -137,4 +137,21 @@ func (s *Store) DeleteKey(key string) (bool, error) {
|
||||
}
|
||||
s.data.Keys = kept
|
||||
return true, s.persistLocked()
|
||||
}
|
||||
|
||||
// AutoRules returns the persisted AUTO scheduling slots.
|
||||
func (s *Store) AutoRules() []ModelScope {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
out := make([]ModelScope, len(s.data.Auto))
|
||||
copy(out, s.data.Auto)
|
||||
return out
|
||||
}
|
||||
|
||||
// SaveAutoRules persists the AUTO scheduling slots.
|
||||
func (s *Store) SaveAutoRules(entries []ModelScope) error {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.data.Auto = entries
|
||||
return s.persistLocked()
|
||||
}
|
||||
Reference in New Issue
Block a user