Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ununsed code #4408

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions gateway/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ type Handle struct {
// state initialised during Setup

diagnosisTicker *time.Ticker
netHandle *http.Client
userWorkerBatchRequestQ chan *userWorkerBatchRequestT
batchUserWorkerBatchRequestQ chan *batchUserWorkerBatchRequestT
irh RequestHandler
Expand Down Expand Up @@ -94,7 +93,6 @@ type Handle struct {
sourceIDSourceMap map[string]backendconfig.SourceT

conf struct { // configuration parameters
httpTimeout time.Duration
webPort, maxUserWebRequestWorkerProcess, maxDBWriterProcess int
maxUserWebRequestBatchSize, maxDBBatchSize, maxHeaderBytes, maxConcurrentRequests int
userWebRequestBatchTimeout, dbBatchWriteTimeout misc.ValueLoader[time.Duration]
Expand Down
2 changes: 0 additions & 2 deletions gateway/handle_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func (gw *Handle) Setup(
gw.rsourcesService = rsourcesService
gw.sourcehandle = sourcehandle

gw.conf.httpTimeout = config.GetDurationVar(30, time.Second, "Gateway.httpTimeout")
// Port where GW is running
gw.conf.webPort = config.GetIntVar(8080, 1, "Gateway.webPort")
// Number of incoming requests that are batched before handing off to write workers
Expand Down Expand Up @@ -113,7 +112,6 @@ func (gw *Handle) Setup(

gw.now = time.Now
gw.diagnosisTicker = time.NewTicker(gw.conf.diagnosisTickerTime)
gw.netHandle = &http.Client{Transport: &http.Transport{}, Timeout: gw.conf.httpTimeout}
gw.userWorkerBatchRequestQ = make(chan *userWorkerBatchRequestT, gw.conf.maxDBBatchSize)
gw.batchUserWorkerBatchRequestQ = make(chan *batchUserWorkerBatchRequestT, gw.conf.maxDBWriterProcess)
gw.irh = &ImportRequestHandler{Handle: gw}
Expand Down
18 changes: 0 additions & 18 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,36 +79,18 @@ type Runner struct {
enableSuppressUserFeature bool
logger logger.Logger
appHandler apphandlers.AppHandler
readTimeout time.Duration
readHeaderTimeout time.Duration
writeTimeout time.Duration
idleTimeout time.Duration
gracefulShutdownTimeout time.Duration
maxHeaderBytes int
}

// New creates and initializes a new Runner
func New(releaseInfo ReleaseInfo) *Runner {
getConfigDuration := func(defaultValueInTimescaleUnits int64, timeScale time.Duration, keys ...string) time.Duration {
for i, key := range keys {
if config.IsSet(key) || i == len(keys)-1 {
return config.GetDuration(key, defaultValueInTimescaleUnits, timeScale)
}
}
return 0
}
return &Runner{
appType: strings.ToUpper(config.GetString("APP_TYPE", app.EMBEDDED)),
releaseInfo: releaseInfo,
logger: logger.NewLogger().Child("runner"),
warehouseMode: config.GetString("Warehouse.mode", "embedded"),
enableSuppressUserFeature: config.GetBool("Gateway.enableSuppressUserFeature", true),
readTimeout: getConfigDuration(0, time.Second, "ReadTimeOut", "ReadTimeOutInSec"),
readHeaderTimeout: getConfigDuration(0, time.Second, "ReadHeaderTimeout", "ReadHeaderTimeoutInSec"),
writeTimeout: getConfigDuration(10, time.Second, "WriteTimeout", "WriteTimeOutInSec"),
idleTimeout: getConfigDuration(720, time.Second, "IdleTimeout", "IdleTimeoutInSec"),
gracefulShutdownTimeout: config.GetDuration("GracefulShutdownTimeout", 15, time.Second),
maxHeaderBytes: config.GetInt("MaxHeaderBytes", 524288),
}
}

Expand Down