Skip to content

Commit

Permalink
chore: ununsed code
Browse files Browse the repository at this point in the history
  • Loading branch information
achettyiitr committed Feb 20, 2024
1 parent ba93342 commit eaf4d51
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
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

0 comments on commit eaf4d51

Please sign in to comment.