]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/toss.go
Fix directories path fsync
[nncp.git] / src / toss.go
index 6f91b43d799cf87100c96dc69deaf219cdd3aa8e..69ad45536e2ba0427e2ba90b5b9d104e6b924301 100644 (file)
@@ -200,7 +200,7 @@ func jobProcess(
                        if doSeen {
                                if fd, err := os.Create(jobPath + SeenSuffix); err == nil {
                                        fd.Close()
-                                       if err = DirSync(filepath.Base(jobPath)); err != nil {
+                                       if err = DirSync(filepath.Dir(jobPath)); err != nil {
                                                ctx.LogE("rx-dirsync", les, err, func(les LEs) string {
                                                        return fmt.Sprintf(
                                                                "Tossing file %s/%s (%s): %s: dirsyncing",
@@ -393,7 +393,7 @@ func jobProcess(
                                if doSeen {
                                        if fd, err := os.Create(jobPath + SeenSuffix); err == nil {
                                                fd.Close()
-                                               if err = DirSync(filepath.Base(jobPath)); err != nil {
+                                               if err = DirSync(filepath.Dir(jobPath)); err != nil {
                                                        ctx.LogE("rx-dirsync", les, err, func(les LEs) string {
                                                                return fmt.Sprintf(
                                                                        "Tossing file %s/%s (%s): %s: dirsyncing",
@@ -518,7 +518,7 @@ func jobProcess(
                                if doSeen {
                                        if fd, err := os.Create(jobPath + SeenSuffix); err == nil {
                                                fd.Close()
-                                               if err = DirSync(filepath.Base(jobPath)); err != nil {
+                                               if err = DirSync(filepath.Dir(jobPath)); err != nil {
                                                        ctx.LogE("rx-dirsync", les, err, func(les LEs) string {
                                                                return fmt.Sprintf(
                                                                        "Tossing file %s/%s (%s): %s: dirsyncing",
@@ -607,7 +607,7 @@ func jobProcess(
                        if doSeen {
                                if fd, err := os.Create(jobPath + SeenSuffix); err == nil {
                                        fd.Close()
-                                       if err = DirSync(filepath.Base(jobPath)); err != nil {
+                                       if err = DirSync(filepath.Dir(jobPath)); err != nil {
                                                ctx.LogE("rx-dirsync", les, err, func(les LEs) string {
                                                        return fmt.Sprintf(
                                                                "Tossing file %s/%s (%s): %s: dirsyncing",