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.

cache.go 654 B

1234567891011121314151617181920212223242526272829303132
  1. package cmdline
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. func CacheMovePackage(ctx CommandContext, packageID int64, nodeID int64) error {
  7. taskID, err := ctx.Cmdline.Svc.CacheSvc().StartCacheMovePackage(0, packageID, nodeID)
  8. if err != nil {
  9. return fmt.Errorf("start cache moving package: %w", err)
  10. }
  11. for {
  12. complete, _, err := ctx.Cmdline.Svc.CacheSvc().WaitCacheMovePackage(nodeID, taskID, time.Second*10)
  13. if complete {
  14. if err != nil {
  15. return fmt.Errorf("moving complete with: %w", err)
  16. }
  17. return nil
  18. }
  19. if err != nil {
  20. return fmt.Errorf("wait moving: %w", err)
  21. }
  22. }
  23. }
  24. func init() {
  25. commands.Add(CacheMovePackage, "cache", "move")
  26. }

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