Skip to content

Commit

Permalink
code cleaning and make uuid optional
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbajoe committed Jun 17, 2024
1 parent e7d03bf commit 3bd5f50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 6 additions & 2 deletions functional-tests/admin_tests/admin_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ PROXY_URL=${PROXY_URL:-"http://localhost"}
DIR="$( cd "$( dirname "$0" )" && pwd )"

# domain setup

id=$(uuid)
# check if uuid is available
if ! command -v uuid > /dev/null; then
id=x-$RANDOM-$RANDOM-$RANDOM
else
id=$(uuid)
fi

dgate-cli namespace create name=ns-$id

Expand Down
7 changes: 2 additions & 5 deletions pkg/storage/file_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@ func NewFileStore(fsConfig *FileStoreConfig) *FileStore {

func (s *FileStore) Connect() (err error) {
filePath := path.Join(s.directory, "dgate.db")
if s.db, err = bolt.Open(filePath,
0755, bolt.DefaultOptions,
); err != nil {
if s.db, err = bolt.Open(filePath, 0755, nil); err != nil {
return err
}
if tx, err := s.db.Begin(true); err != nil {
} else if tx, err := s.db.Begin(true); err != nil {
return err

Check warning on line 71 in pkg/storage/file_storage.go

View check run for this annotation

Codecov / codecov/patch

pkg/storage/file_storage.go#L66-L71

Added lines #L66 - L71 were not covered by tests
} else {
_, err = tx.CreateBucketIfNotExists(s.bucketName)
Expand Down

0 comments on commit 3bd5f50

Please sign in to comment.