From 1752511c3e0f54828149a80ecb65d7f16a261bef Mon Sep 17 00:00:00 2001 From: Sydonian <794346190@qq.com> Date: Wed, 24 May 2023 10:28:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=8A=82=E7=82=B9=E6=A3=80?= =?UTF-8?q?=E6=9F=A5Cache=E7=9A=84=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consts/event/event.go | 3 ++- utils/ipfs/ipfs.go | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/consts/event/event.go b/consts/event/event.go index d4ca515..7a1039d 100644 --- a/consts/event/event.go +++ b/consts/event/event.go @@ -1,7 +1,8 @@ package event const ( - UPDATE_CACHE_OP_UNTEMP = "UnTemp" + UPDATE_CACHE_UNTEMP = "UnTemp" + UPDATE_CACHE_CREATE_TEMP = "CreateTemp" ) const ( diff --git a/utils/ipfs/ipfs.go b/utils/ipfs/ipfs.go index 33dfd06..42e2b40 100644 --- a/utils/ipfs/ipfs.go +++ b/utils/ipfs/ipfs.go @@ -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