Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Oct 18, 2015
1 parent 942eb25 commit 8ba7f9e
Show file tree
Hide file tree
Showing 27 changed files with 730 additions and 1,252 deletions.
4 changes: 2 additions & 2 deletions nsqd/rename.go → internal/atomic_rename/rename.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// +build !windows

package nsqd
package atomic_rename

import (
"os"
)

func atomicRename(sourceFile, targetFile string) error {
func Rename(sourceFile, targetFile string) error {
return os.Rename(sourceFile, targetFile)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build windows

package nsqd
package atomic_rename

import (
"syscall"
Expand All @@ -27,7 +27,7 @@ func moveFileEx(sourceFile, targetFile *uint16, flags uint32) error {
return nil
}

func atomicRename(sourceFile, targetFile string) error {
func Rename(sourceFile, targetFile string) error {
lpReplacedFileName, err := syscall.UTF16PtrFromString(targetFile)
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build windows

package nsqd
package atomic_rename

import (
"fmt"
Expand Down Expand Up @@ -55,11 +55,11 @@ func TestConcurrentRenames(t *testing.T) {

waitGroup.Wrap(func() {
_, _ = <-trigger
err := atomicRename(sourcePath1, targetPath)
err := Rename(sourcePath1, targetPath)
if err != nil {
t.Error(err)
}
err = atomicRename(sourcePath2, targetPath)
err = Rename(sourcePath2, targetPath)
if err != nil {
t.Error(err)
}
Expand Down
12 changes: 0 additions & 12 deletions nsqd/backend_queue.go

This file was deleted.

Loading

0 comments on commit 8ba7f9e

Please sign in to comment.