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

tss: Populate tss worker pools #49

Merged
merged 142 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
a58d519
tables and interfaces for TSS
gouthamp-stellar Aug 30, 2024
9920f48
TSS tables and the channel interface
gouthamp-stellar Aug 30, 2024
3f9f9f0
remove empty lines
gouthamp-stellar Aug 30, 2024
373c71a
update
gouthamp-stellar Aug 30, 2024
2de9898
adding semicolons
gouthamp-stellar Aug 30, 2024
c0f9d32
moving all migrations to one file
gouthamp-stellar Aug 30, 2024
a9cf4e3
make hash primary key instead of xdr
gouthamp-stellar Sep 3, 2024
6fc0dc2
missing ,
gouthamp-stellar Sep 3, 2024
fb807aa
remove the index on try_transaction_xdr and add column/index on try_t…
gouthamp-stellar Sep 3, 2024
f8c261b
Squashed commit of the following:
gouthamp-stellar Sep 4, 2024
d774f2a
commit #2
gouthamp-stellar Sep 5, 2024
6b04d62
changing from RpcIngestTxResponse -> RpcGetIngestTxResponse
gouthamp-stellar Sep 5, 2024
f2fefef
Merge branch 'tss_tables_interfaces' into transaction_module
gouthamp-stellar Sep 5, 2024
b441a31
latest changes
gouthamp-stellar Sep 7, 2024
02c7de3
add tests for ValidateOptions
gouthamp-stellar Sep 8, 2024
f9a5611
changes based on comments
gouthamp-stellar Sep 10, 2024
32bd6ce
Merge branch 'main' into tss_tables_interfaces
gouthamp-stellar Sep 10, 2024
5c7db27
Merge branch 'tss_tables_interfaces' into transaction_module
gouthamp-stellar Sep 10, 2024
c3e8de9
latest changes based on changes to interface
gouthamp-stellar Sep 10, 2024
82b12fb
string -> RPCTXStatus
gouthamp-stellar Sep 10, 2024
9a9c9be
Merge branch 'tss_tables_interfaces' into transaction_module
gouthamp-stellar Sep 10, 2024
0662da9
adding a transaction_builder.go which takes a list of operation xdrs …
gouthamp-stellar Sep 11, 2024
8f76d61
moving transaction_service to the utils dir
gouthamp-stellar Sep 11, 2024
456b71f
upper case Channel methods
gouthamp-stellar Sep 11, 2024
7974aa9
Merge branch 'tss_tables_interfaces' into transaction_module
gouthamp-stellar Sep 11, 2024
5bdf8f2
latest changes
gouthamp-stellar Sep 12, 2024
3890bfe
p.txService.NetworkPassPhrase()
gouthamp-stellar Sep 12, 2024
e87c6d6
last commit before writing unit tests
gouthamp-stellar Sep 13, 2024
c1d3786
Making the transaction service more injectible and adding fields to t…
gouthamp-stellar Sep 13, 2024
01ed3eb
typo
gouthamp-stellar Sep 13, 2024
3ddd2bd
typo
gouthamp-stellar Sep 13, 2024
5776cb1
Update 2024-08-28.0-tss_transactions.sql
gouthamp-stellar Sep 13, 2024
2c6db84
Merge branch 'main' into transaction_module
gouthamp-stellar Sep 13, 2024
77a6e4b
lint errors
gouthamp-stellar Sep 13, 2024
01109ab
go mod tidy
gouthamp-stellar Sep 13, 2024
c005a06
Merge branch 'main' into transaction_module
gouthamp-stellar Sep 13, 2024
f560a05
Merge branch 'transaction_module' into rpc_caller_service
gouthamp-stellar Sep 13, 2024
38ba21b
test cases + other changes
gouthamp-stellar Sep 15, 2024
8ddb961
remoce unused mocks
gouthamp-stellar Sep 15, 2024
d32adb1
error handler service returns errorHandlerService
gouthamp-stellar Sep 15, 2024
e0727b5
changes based on comments
gouthamp-stellar Sep 18, 2024
968a6b7
lint deadcode error - suppress for now
gouthamp-stellar Sep 18, 2024
096c7bd
removed deadcode
gouthamp-stellar Sep 18, 2024
6cfc3fd
changes after comments on transaction service pr
gouthamp-stellar Sep 18, 2024
c195365
TSS Error Handler Service
gouthamp-stellar Sep 19, 2024
da2b40b
removing print statements
gouthamp-stellar Sep 19, 2024
b71e342
Update transaction_service.go
gouthamp-stellar Sep 19, 2024
ccf27f1
responding to comments
gouthamp-stellar Sep 20, 2024
8045d8d
remove commented code
gouthamp-stellar Sep 20, 2024
d062a11
tx service changes
gouthamp-stellar Sep 20, 2024
1a3c17c
remove comment
gouthamp-stellar Sep 20, 2024
174ed45
remove comment
gouthamp-stellar Sep 20, 2024
9492d71
latest tx service changes
gouthamp-stellar Sep 20, 2024
5d31b01
adding a router + utils file
gouthamp-stellar Sep 20, 2024
a6dc954
removing println
gouthamp-stellar Sep 20, 2024
e28ff02
changed function name
gouthamp-stellar Sep 20, 2024
3d69601
commit #1
gouthamp-stellar Sep 21, 2024
43fcf10
Code() helper function on RPCTXCode
gouthamp-stellar Sep 21, 2024
4793f90
Code()
gouthamp-stellar Sep 21, 2024
a401c30
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Sep 21, 2024
b5d46da
Delete .env.swp
gouthamp-stellar Sep 21, 2024
b4ab5de
adding a helpers file
gouthamp-stellar Sep 21, 2024
f10d239
removing BuildTestFeeBumpTransaction
gouthamp-stellar Sep 21, 2024
d679abd
adding to serve.go etc
gouthamp-stellar Sep 22, 2024
db8714d
casing
gouthamp-stellar Sep 22, 2024
2c0d060
better test for Send
gouthamp-stellar Sep 23, 2024
b82a25a
Merge branch 'transaction_module' into rpc_caller_service
gouthamp-stellar Sep 23, 2024
97da8d6
Merge branch 'rpc_caller_service' into error_handler_service
gouthamp-stellar Sep 23, 2024
9d1266b
resolving merge conflicts
gouthamp-stellar Sep 23, 2024
ea229bb
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Sep 23, 2024
a196677
removing mockSleep
gouthamp-stellar Sep 23, 2024
875b1dd
delete channels/mocks.go
gouthamp-stellar Sep 23, 2024
d1eee64
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Sep 23, 2024
aff5ed4
sleep -> time.Sleep
gouthamp-stellar Sep 23, 2024
101bd43
Merge branch 'main' into rpc_caller_service
gouthamp-stellar Sep 25, 2024
637aeaf
incorporating Daniel's changes + comments
gouthamp-stellar Sep 26, 2024
0fb94e3
delete files
gouthamp-stellar Sep 26, 2024
df7ae05
remove unused code
gouthamp-stellar Sep 26, 2024
cf2dc18
name change
gouthamp-stellar Sep 26, 2024
16581fd
remove commented code
gouthamp-stellar Sep 26, 2024
ab7c0d7
moving the mocks file inside servicesmocks dir
gouthamp-stellar Sep 26, 2024
5fe5d0b
name changes
gouthamp-stellar Sep 26, 2024
76df04b
refactor
gouthamp-stellar Sep 26, 2024
49ec16b
Merge branch 'rpc_caller_service' into error_handler_service
gouthamp-stellar Sep 26, 2024
3b174b8
changes to serve.go
gouthamp-stellar Sep 26, 2024
22ed801
checking error on route.Route
gouthamp-stellar Sep 26, 2024
9cb0145
check error
gouthamp-stellar Sep 26, 2024
78042c9
Merge branch 'main' into rpc_caller_service
gouthamp-stellar Sep 26, 2024
9118a06
merging main
gouthamp-stellar Sep 26, 2024
12425f9
fixing parsesendresp tests
gouthamp-stellar Sep 26, 2024
897a218
Merge branch 'rpc_caller_service' into error_handler_service
gouthamp-stellar Sep 26, 2024
6e93627
commit changes
gouthamp-stellar Sep 26, 2024
56f8e5a
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Sep 26, 2024
4e324a6
merging in changes from eror_handler_service
gouthamp-stellar Sep 26, 2024
4fff039
delete file
gouthamp-stellar Sep 26, 2024
f4aaf93
commit current changes before merging branch
gouthamp-stellar Sep 27, 2024
d9283bf
Merge branch 'webhook_handler_service' into rpc_ingestor
gouthamp-stellar Sep 27, 2024
f139f7a
rpc ingestor
gouthamp-stellar Sep 30, 2024
edcd0e7
delete file
gouthamp-stellar Sep 30, 2024
cd321ae
fix lint errors
gouthamp-stellar Sep 30, 2024
43711ca
remove dead code
gouthamp-stellar Sep 30, 2024
757e6d5
fix broken test + delete unused code
gouthamp-stellar Sep 30, 2024
42edf1f
tidy mod
gouthamp-stellar Sep 30, 2024
5ff3984
remove commented code
gouthamp-stellar Sep 30, 2024
715ae3f
delete file
gouthamp-stellar Sep 30, 2024
6b2a6f7
changes based on comments
gouthamp-stellar Sep 30, 2024
b4f6052
removing test case that is not relevant anymore
gouthamp-stellar Sep 30, 2024
3d6746e
Merge branch 'rpc_caller_service' into error_handler_service
gouthamp-stellar Sep 30, 2024
9be1beb
changes based on prev pr comments
gouthamp-stellar Sep 30, 2024
0df3537
remove fmt.Println
gouthamp-stellar Sep 30, 2024
dc9a363
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Oct 1, 2024
8c445f4
merge latest error_handler_service branch + small changes
gouthamp-stellar Oct 1, 2024
2caf65b
%s -> %w
gouthamp-stellar Oct 1, 2024
ab2a546
U -> u
gouthamp-stellar Oct 1, 2024
277b970
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Oct 1, 2024
d576a25
variable for channel name
gouthamp-stellar Oct 1, 2024
b2a1cd8
Merge branch 'webhook_handler_service' into rpc_ingestor
gouthamp-stellar Oct 1, 2024
5de4041
account for NewStore returning an error
gouthamp-stellar Oct 1, 2024
a788011
fix build
gouthamp-stellar Oct 1, 2024
22b0438
commit #1
gouthamp-stellar Oct 1, 2024
ef1c7be
tss pool populator
gouthamp-stellar Oct 3, 2024
2f4ae28
typo
gouthamp-stellar Oct 3, 2024
450fd41
typo
gouthamp-stellar Oct 3, 2024
d0fa39d
Merge branch 'main' into webhook_handler_service
gouthamp-stellar Oct 9, 2024
44cb3ec
merge main
gouthamp-stellar Oct 9, 2024
afebef4
Merge branch 'webhook_handler_service' into rpc_ingestor
gouthamp-stellar Oct 9, 2024
61cf2db
merged latest
gouthamp-stellar Oct 10, 2024
9e5d6e9
Merge branch 'rpc_ingestor' into populate_pools
gouthamp-stellar Oct 10, 2024
ad392d8
typo in desc string
gouthamp-stellar Oct 15, 2024
dbe9629
millisecond wait time
gouthamp-stellar Oct 15, 2024
f63304b
Merge branch 'webhook_handler_service' into rpc_ingestor
gouthamp-stellar Oct 15, 2024
0957985
changes based on comments
gouthamp-stellar Oct 15, 2024
39895ad
Merge branch 'rpc_ingestor' into populate_pools
gouthamp-stellar Oct 15, 2024
c889a86
typo
gouthamp-stellar Oct 15, 2024
eb49994
changes based on comments
gouthamp-stellar Oct 16, 2024
f50ba23
fixing migrations
gouthamp-stellar Oct 16, 2024
01f2d49
compare types directly on route
gouthamp-stellar Oct 16, 2024
6decb98
assert
gouthamp-stellar Oct 16, 2024
693764b
changes based on comments
gouthamp-stellar Oct 23, 2024
0019e23
Merge branch 'main' into populate_pools
gouthamp-stellar Oct 23, 2024
7e8f3ba
renaming tss_options
gouthamp-stellar Oct 23, 2024
c67560a
oops
gouthamp-stellar Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 20 additions & 27 deletions cmd/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package cmd
import (
"fmt"
"go/types"
"net/http"
"time"

_ "github.com/lib/pq"
"github.com/spf13/cobra"
Expand All @@ -11,6 +13,7 @@ import (
"github.com/stellar/wallet-backend/cmd/utils"
"github.com/stellar/wallet-backend/internal/apptracker/sentry"
"github.com/stellar/wallet-backend/internal/ingest"
tsschannels "github.com/stellar/wallet-backend/internal/tss/channels"
)

type ingestCmd struct{}
Expand All @@ -22,28 +25,15 @@ func (c *ingestCmd) Command() *cobra.Command {
cfgOpts := config.ConfigOptions{
utils.DatabaseURLOption(&cfg.DatabaseURL),
utils.LogLevelOption(&cfg.LogLevel),
utils.NetworkPassphraseOption(&cfg.NetworkPassphrase),
utils.SentryDSNOption(&sentryDSN),
utils.StellarEnvironmentOption(&stellarEnvironment),
utils.RPCURLOption(&cfg.RPCURL),
{
Name: "captive-core-bin-path",
Usage: "Path to Captive Core's binary file.",
OptType: types.String,
CustomSetValue: utils.SetConfigOptionCaptiveCoreBinPath,
ConfigKey: &cfg.CaptiveCoreBinPath,
FlagDefault: "/usr/local/bin/stellar-core",
Required: true,
},
{
Name: "captive-core-config-dir",
Usage: "Path to Captive Core's configuration files directory.",
OptType: types.String,
CustomSetValue: utils.SetConfigOptionCaptiveCoreConfigDir,
ConfigKey: &cfg.CaptiveCoreConfigDir,
FlagDefault: "./internal/ingest/config",
Required: true,
},
utils.StartLedgerOption(&cfg.StartLedger),
utils.EndLedgerOption(&cfg.EndLedger),
utils.WebhookHandlerServiceChannelMaxBufferSizeOption(&cfg.WebhookChannelMaxBufferSize),
utils.WebhookHandlerServiceChannelMaxWorkersOptions(&cfg.WebhookChannelMaxWorkers),
utils.WebhookHandlerServiceChannelMaxRetriesOption(&cfg.WebhookChannelMaxRetries),
utils.WebhookHandlerServiceChannelMinWaitBtwnRetriesMSOption(&cfg.WebhookChannelWaitBtwnTriesMS),
{
Name: "ledger-cursor-name",
Usage: "Name of last synced ledger cursor, used to keep track of the last ledger ingested by the service. When starting up, ingestion will resume from the ledger number stored in this record. It should be an unique name per container as different containers would overwrite the cursor value of its peers when using the same cursor name.",
Expand All @@ -60,20 +50,13 @@ func (c *ingestCmd) Command() *cobra.Command {
FlagDefault: 0,
Required: false,
},
{
Name: "end",
Usage: "Ledger number up to which ingestion should run. When not present, ingestion run indefinitely (live ingestion requires it to be empty).",
OptType: types.Int,
ConfigKey: &cfg.EndLedger,
FlagDefault: 0,
Required: false,
},
}

cmd := &cobra.Command{
Use: "ingest",
Short: "Run Ingestion service",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
// SET UP WEBHOOK CHANNEL HERE
if err := cfgOpts.RequireE(); err != nil {
return fmt.Errorf("requiring values of config options: %w", err)
}
Expand All @@ -85,11 +68,21 @@ func (c *ingestCmd) Command() *cobra.Command {
return fmt.Errorf("initializing app tracker: %w", err)
}
cfg.AppTracker = appTracker
cfg.WebhookChannel = tsschannels.NewWebhookChannel(tsschannels.WebhookChannelConfigs{
HTTPClient: &http.Client{Timeout: 30 * time.Second},
MaxBufferSize: cfg.WebhookChannelMaxBufferSize,
MaxWorkers: cfg.WebhookChannelMaxWorkers,
MaxRetries: cfg.WebhookChannelMaxRetries,
MinWaitBtwnRetriesMS: cfg.WebhookChannelWaitBtwnTriesMS,
})
return nil
},
RunE: func(_ *cobra.Command, _ []string) error {
return c.Run(cfg)
},
PersistentPostRun: func(_ *cobra.Command, _ []string) {
cfg.WebhookChannel.Stop()
},
}

if err := cfgOpts.Init(cmd); err != nil {
Expand Down
5 changes: 5 additions & 0 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func (c *serveCmd) Command() *cobra.Command {
utils.ErrorHandlerServiceNonJitterChannelWaitBtwnRetriesMSOption(&cfg.ErrorHandlerServiceNonJitterChannelWaitBtwnRetriesMS),
utils.ErrorHandlerServiceJitterChannelMaxRetriesOptions(&cfg.ErrorHandlerServiceJitterChannelMaxRetries),
utils.ErrorHandlerServiceNonJitterChannelMaxRetriesOption(&cfg.ErrorHandlerServiceNonJitterChannelMaxRetries),
utils.WebhookHandlerServiceChannelMaxBufferSizeOption(&cfg.WebhookHandlerServiceChannelMaxBufferSize),
utils.WebhookHandlerServiceChannelMaxWorkersOptions(&cfg.WebhookHandlerServiceChannelMaxWorkers),
utils.WebhookHandlerServiceChannelMaxRetriesOption(&cfg.WebhookHandlerServiceChannelMaxRetries),
utils.WebhookHandlerServiceChannelMinWaitBtwnRetriesMSOption(&cfg.WebhookHandlerServiceChannelMinWaitBtwnRetriesMS),

{
Name: "port",
Usage: "Port to listen and serve on",
Expand Down
44 changes: 0 additions & 44 deletions cmd/utils/custom_set_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package utils

import (
"encoding/json"
"errors"
"fmt"
"os"
"strings"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -83,48 +81,6 @@ func SetConfigOptionStellarPrivateKey(co *config.ConfigOption) error {
return nil
}

func SetConfigOptionCaptiveCoreBinPath(co *config.ConfigOption) error {
binPath := viper.GetString(co.Name)

fileInfo, err := os.Stat(binPath)
if errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("binary file %s does not exist", binPath)
}

if fileInfo.IsDir() {
return fmt.Errorf("binary file path %s is a directory, not a file", binPath)
}

key, ok := co.ConfigKey.(*string)
if !ok {
return unexpectedTypeError(key, co)
}
*key = binPath

return nil
}

func SetConfigOptionCaptiveCoreConfigDir(co *config.ConfigOption) error {
dirPath := viper.GetString(co.Name)

fileInfo, err := os.Stat(dirPath)
if errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("captive core configuration files dir %s does not exist", dirPath)
}

if !fileInfo.IsDir() {
return fmt.Errorf("captive core configuration files dir %s is not a directory", dirPath)
}

key, ok := co.ConfigKey.(*string)
if !ok {
return unexpectedTypeError(key, co)
}
*key = dirPath

return nil
}

func SetConfigOptionAssets(co *config.ConfigOption) error {
assetsJSON := viper.GetString(co.Name)

Expand Down
91 changes: 0 additions & 91 deletions cmd/utils/custom_set_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,97 +220,6 @@ func Test_SetConfigOptionLogLevel(t *testing.T) {
}
}

func TestSetConfigOptionCaptiveCoreBinPath(t *testing.T) {
opts := struct{ binPath string }{}

co := config.ConfigOption{
Name: "captive-core-bin-path",
OptType: types.String,
CustomSetValue: SetConfigOptionCaptiveCoreBinPath,
ConfigKey: &opts.binPath,
}

testCases := []customSetterTestCase[string]{
{
name: "returns an error if the file path is not set, should be caught by the Require() function",
wantErrContains: "binary file does not exist",
},
{
name: "returns an error if the path is invalid",
args: []string{"--captive-core-bin-path", "/a/random/path/bin"},
wantErrContains: "binary file /a/random/path/bin does not exist",
},
{
name: "returns an error if the path format is invalid",
args: []string{"--captive-core-bin-path", "^7JcrS8J4q@V0$c"},
wantErrContains: "binary file ^7JcrS8J4q@V0$c does not exist",
},
{
name: "returns an error if the path is a directory, not a file",
args: []string{"--captive-core-bin-path", "./"},
wantErrContains: "binary file path ./ is a directory, not a file",
},
{
name: "sets to ENV var value",
envValue: "./custom_set_value_test.go",
wantResult: "./custom_set_value_test.go",
},
}

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
opts.binPath = ""
customSetterTester(t, tc, co)
})
}
}

func TestSetConfigOptionCaptiveCoreConfigDir(t *testing.T) {
opts := struct{ binPath string }{}

co := config.ConfigOption{
Name: "captive-core-config-dir",
OptType: types.String,
CustomSetValue: SetConfigOptionCaptiveCoreConfigDir,
ConfigKey: &opts.binPath,
}

testCases := []customSetterTestCase[string]{
{
name: "returns an error if the file path is not set, should be caught by the Require() function",
wantErrContains: "captive core configuration files dir does not exist",
},
{
name: "returns an error if the path is invalid",
envValue: "/a/random/path",
wantErrContains: "captive core configuration files dir /a/random/path does not exist",
},
{
name: "returns an error if the path format is invalid",
envValue: "^7JcrS8J4q@V0$c",
wantErrContains: "captive core configuration files dir ^7JcrS8J4q@V0$c does not exist",
},

{
name: "returns an error if the path is a file, not a directory",
envValue: "./custom_set_value_test.go",
wantErrContains: "captive core configuration files dir ./custom_set_value_test.go is not a directory",
},
{
name: "sets to ENV var value",
envValue: "../../internal/ingest/config",
wantResult: "../../internal/ingest/config",
},
}

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
opts.binPath = ""
customSetterTester(t, tc, co)
})
}
}

func TestSetConfigOptionAssets(t *testing.T) {
opts := struct{ assets []entities.Asset }{}

Expand Down
24 changes: 24 additions & 0 deletions cmd/utils/global_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,30 @@ func DistributionAccountSignatureClientProviderOption(configKey *signing.Signatu
}
}

func StartLedgerOption(configKey *int) *config.ConfigOption {
return &config.ConfigOption{
Name: "start-ledger",
Usage: "ledger number to start getting transactions from",
OptType: types.Int,
ConfigKey: configKey,
FlagDefault: 0,
Required: true,
}

}

func EndLedgerOption(configKey *int) *config.ConfigOption {
return &config.ConfigOption{
Name: "end-ledger",
Usage: "ledger number to end on",
OptType: types.Int,
ConfigKey: configKey,
FlagDefault: 0,
Required: true,
}

}

func AWSOptions(awsRegionConfigKey *string, kmsKeyARN *string, required bool) config.ConfigOptions {
awsOpts := config.ConfigOptions{
{
Expand Down
44 changes: 44 additions & 0 deletions cmd/utils/tss_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,47 @@ func ErrorHandlerServiceNonJitterChannelMaxRetriesOption(configKey *int) *config
Required: true,
}
}

func WebhookHandlerServiceChannelMaxBufferSizeOption(configKey *int) *config.ConfigOption {
return &config.ConfigOption{
Name: "webhook-service-channel-max-buffer-size",
Usage: "Set the buffer size of the webhook serive channel.",
OptType: types.Int,
ConfigKey: configKey,
FlagDefault: 100,
Required: true,
}
}

func WebhookHandlerServiceChannelMaxWorkersOptions(configKey *int) *config.ConfigOption {
return &config.ConfigOption{
Name: "webhook-service-channel-max-workers",
Usage: "Set the max number of workers for the webhook serive channel.",
OptType: types.Int,
ConfigKey: configKey,
FlagDefault: 10,
Required: true,
}
}

func WebhookHandlerServiceChannelMaxRetriesOption(configKey *int) *config.ConfigOption {
return &config.ConfigOption{
Name: "webhook-service-channel-max-retries",
Usage: "Set the max number of times to ping a webhook before quitting.",
OptType: types.Int,
ConfigKey: configKey,
FlagDefault: 3,
Required: true,
}
}

func WebhookHandlerServiceChannelMinWaitBtwnRetriesMSOption(configKey *int) *config.ConfigOption {
return &config.ConfigOption{
Name: "webhook-service-channel-min-wait-between-retries",
Usage: "The minumum amout of time to wait before repining the webhook url",
OptType: types.Int,
ConfigKey: configKey,
FlagDefault: 10,
Required: true,
}
}
Loading