File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 55 "fmt"
66 "log"
77 "syscall"
8+ "time"
89
910 "github.com/DataManager-Go/libdatamanager"
1011 dmConfig "github.com/DataManager-Go/libdatamanager/config"
@@ -76,8 +77,20 @@ func (root *dmanagerRoot) OnAdd(ctx context.Context) {
7677// Unlink if virtual file was unlinked
7778func (root * dmanagerRoot ) Rmdir (ctx context.Context , name string ) syscall.Errno {
7879 namespace := addNSName (name , root .libdm .Config )
79- // TODO delete namespace
80- fmt .Println ("rm" , namespace )
80+
81+ // wait 2 seconds to ensure, user didn't cancel
82+ select {
83+ case <- ctx .Done ():
84+ return syscall .ECANCELED
85+ case <- time .After (2 * time .Second ):
86+ }
87+
88+ // Do delete request
89+ if _ , err := root .libdm .DeleteNamespace (namespace ); err != nil {
90+ fmt .Println (err )
91+ return syscall .EFAULT
92+ }
93+
8194 return 0
8295}
8396
You can’t perform that action at this time.
0 commit comments