Skip to content

Commit

Permalink
Replaced os.Rename with lib implementation for tmpfs support (cf. uhp…
Browse files Browse the repository at this point in the history
  • Loading branch information
twystd committed Aug 1, 2023
1 parent fa556b9 commit 5b7c8ee
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
1. Reworked command line arguments to specify ACL table using --table:ACL option.
2. Reworked sqlite3 implementation to replace the UPSERT with an ON CONFLICT REPLACE
clause in the CREATE TABLE.
3. Replaced os.Rename with lib implementation for tmpfs support.


## [0.8.5](https://github.com/uhppoted/uhppoted-app-db/releases/tag/v0.8.5) - 2023-06-13
Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [x] MySQL support (cf. https://github.com/uhppoted/uhppoted-app-db/issues/1)
- [x] Clean up DSN/DB logic
- [x] sqlite3: replace UPSERTs with TABLE ON CONFLICT REPLACE clause
- [x] Replace os.Rename with lib implementation for tmpfs support (cf. https://github.com/uhppoted/uhppoted-httpd/issues/20)

## TODO

Expand Down
3 changes: 2 additions & 1 deletion commands/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/uhppoted/uhppote-core/uhppote"
"github.com/uhppoted/uhppoted-lib/config"
"github.com/uhppoted/uhppoted-lib/lockfile"
lib "github.com/uhppoted/uhppoted-lib/os"

"github.com/uhppoted/uhppoted-app-db/log"
)
Expand Down Expand Up @@ -119,7 +120,7 @@ func write(file string, bytes []byte) error {
dir := filepath.Dir(file)
if err := os.MkdirAll(dir, 0770); err != nil {
return err
} else if err := os.Rename(tmp.Name(), file); err != nil {
} else if err := lib.Rename(tmp.Name(), file); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/mattn/go-sqlite3 v1.14.16
github.com/microsoft/go-mssqldb v1.1.0
github.com/uhppoted/uhppote-core v0.8.6-0.20230714164141-912d472ef6df
github.com/uhppoted/uhppoted-lib v0.8.6-0.20230714155133-57e68f2d1360
github.com/uhppoted/uhppoted-lib v0.8.6-0.20230801163955-16b4119234e5
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/uhppoted/uhppote-core v0.8.6-0.20230714164141-912d472ef6df h1:HdvJy+Idu6E0xRdSeILN4qWt9iGfv7dM5KtoJisg8JA=
github.com/uhppoted/uhppote-core v0.8.6-0.20230714164141-912d472ef6df/go.mod h1:q3xZZc7GMkCfpVnKNmdoZQDjvMHfPvH79VNai7HDH3s=
github.com/uhppoted/uhppoted-lib v0.8.6-0.20230714155133-57e68f2d1360 h1:XaVqmMmjwskTrX6iCdUl2I4ezrvuoA/yhLzf/455E10=
github.com/uhppoted/uhppoted-lib v0.8.6-0.20230714155133-57e68f2d1360/go.mod h1:3lLcVCtew+bIr0qftO/VsqmJLEoBaItX9rm9lLVusJE=
github.com/uhppoted/uhppoted-lib v0.8.6-0.20230801163955-16b4119234e5 h1:B4RxLs3eVOZ0GQcQ7A865RSzErxcwnIflG49MGIv4Ls=
github.com/uhppoted/uhppoted-lib v0.8.6-0.20230801163955-16b4119234e5/go.mod h1:3lLcVCtew+bIr0qftO/VsqmJLEoBaItX9rm9lLVusJE=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
Expand Down

0 comments on commit 5b7c8ee

Please sign in to comment.