Browse Source

完成节点检查Cache的任务

pull/1/head
Sydonian 2 years ago
parent
commit
1752511c3e
2 changed files with 7 additions and 1 deletions
  1. +2
    -1
      consts/event/event.go
  2. +5
    -0
      utils/ipfs/ipfs.go

+ 2
- 1
consts/event/event.go View File

@@ -1,7 +1,8 @@
package event

const (
UPDATE_CACHE_OP_UNTEMP = "UnTemp"
UPDATE_CACHE_UNTEMP = "UnTemp"
UPDATE_CACHE_CREATE_TEMP = "CreateTemp"
)

const (


+ 5
- 0
utils/ipfs/ipfs.go View File

@@ -1,6 +1,7 @@
package ipfs

import (
"context"
"fmt"
"io"

@@ -61,6 +62,10 @@ func (fs *IPFS) Unpin(hash string) error {
return fs.shell.Unpin(hash)
}

func (fs *IPFS) GetPinnedFiles() (map[string]shell.PinInfo, error) {
return fs.shell.PinsOfType(context.Background(), shell.RecursivePin)
}

type ipfsWriter struct {
writer *io.PipeWriter
finished chan any


Loading…
Cancel
Save