[#70] Support client cut

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
Denis Kirillov 2023-08-21 16:50:23 +03:00 committed by Alexey Vanin
parent e61b4867c9
commit 9b34413e17
8 changed files with 44 additions and 1 deletions

View file

@ -75,6 +75,7 @@ type (
mu sync.RWMutex
defaultTimestamp bool
zipCompression bool
clientCut bool
}
)
@ -164,6 +165,18 @@ func (s *appSettings) setZipCompression(val bool) {
s.mu.Unlock()
}
func (s *appSettings) ClientCut() bool {
s.mu.RLock()
defer s.mu.RUnlock()
return s.clientCut
}
func (s *appSettings) setClientCut(val bool) {
s.mu.Lock()
s.clientCut = val
s.mu.Unlock()
}
func (a *app) initAppSettings() {
a.settings = &appSettings{}
@ -448,6 +461,7 @@ func (a *app) configReload(ctx context.Context) {
func (a *app) updateSettings() {
a.settings.setDefaultTimestamp(a.cfg.GetBool(cfgUploaderHeaderEnableDefaultTimestamp))
a.settings.setZipCompression(a.cfg.GetBool(cfgZipCompression))
a.settings.setClientCut(a.cfg.GetBool(cfgClientCut))
}
func (a *app) startServices() {