-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactor/internal-o11y/update-otel
- Loading branch information
Showing
8 changed files
with
1,330 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
name: "Update web contents" | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- "release/v*.*" | ||
tags: | ||
- "*.*.*" | ||
- "v*.*.*" | ||
- "*.*.*-*" | ||
- "v*.*.*-*" | ||
paths: | ||
- "**.md" | ||
- "assets/docs/**" | ||
jobs: | ||
dispatch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Dispatch | ||
run: | | ||
curl --fail -u "${USER}:${TOKEN}" \ | ||
-X POST https://api.github.com/repos/vdaas/web/dispatches \ | ||
-H 'Accept: application/vnd.github.everest-preview+json' \ | ||
--data '{"event_type": "update-contents"}' | ||
env: | ||
USER: ${{ secrets.DISPATCH_USER }} | ||
TOKEN: ${{ secrets.DISPATCH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// Copyright (C) 2019-2024 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// You may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package pogreb | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/akrylysov/pogreb" | ||
) | ||
|
||
var deafultOpts = []Option{ | ||
WithPath("pogreb.db"), | ||
WithBackgroundSyncInterval("5s"), | ||
} | ||
|
||
// Option represents the functional option for database. | ||
type Option func(*db) error | ||
|
||
// WithPath returns the option to set path. | ||
func WithPath(path string) Option { | ||
return func(d *db) error { | ||
if path != "" { | ||
d.path = path | ||
} | ||
return nil | ||
} | ||
} | ||
|
||
// WithBackgroundSyncInterval returns the option to sets the amount of time between background Sync() calls. | ||
// Setting the value to 0 disables the automatic background synchronization. | ||
// Setting the value to -1 or less makes the DB call Sync() after every write operation. | ||
func WithBackgroundSyncInterval(s string) Option { | ||
return func(d *db) error { | ||
if s == "" { | ||
return nil | ||
} | ||
dur, err := time.ParseDuration(s) | ||
if err != nil { | ||
return err | ||
} | ||
if d.opts == nil { | ||
d.opts = new(pogreb.Options) | ||
} | ||
if dur < -1 { | ||
dur = -1 | ||
} | ||
d.opts.BackgroundSyncInterval = dur | ||
return nil | ||
} | ||
} | ||
|
||
// WithBackgroundCompactionInterval returns the option to sets the amount of time between background Compact() calls. | ||
// Setting the value to 0 or less disables the automatic background compaction. | ||
func WithBackgroundCompactionInterval(s string) Option { | ||
return func(d *db) error { | ||
if s == "" { | ||
return nil | ||
} | ||
dur, err := time.ParseDuration(s) | ||
if err != nil { | ||
return err | ||
} | ||
if d.opts == nil { | ||
d.opts = new(pogreb.Options) | ||
} | ||
|
||
if dur < 0 { | ||
dur = 0 | ||
} | ||
d.opts.BackgroundCompactionInterval = dur | ||
return nil | ||
} | ||
} |
Oops, something went wrong.