You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

host.go 475 B

7 months ago
7 months ago
7 months ago
7 months ago
12345678910111213141516171819202122232425262728293031323334
  1. package metacache
  2. import (
  3. "time"
  4. "gitlink.org.cn/cloudream/jcs-pub/client/internal/db"
  5. )
  6. type MetaCache interface {
  7. ClearOutdated()
  8. }
  9. type MetaCacheHost struct {
  10. db *db.DB
  11. caches []MetaCache
  12. }
  13. func NewHost(db *db.DB) *MetaCacheHost {
  14. return &MetaCacheHost{
  15. db: db,
  16. }
  17. }
  18. func (m *MetaCacheHost) Serve() {
  19. ticker := time.NewTicker(time.Minute)
  20. for {
  21. select {
  22. case <-ticker.C:
  23. for _, cache := range m.caches {
  24. cache.ClearOutdated()
  25. }
  26. }
  27. }
  28. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。