Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
chore(BUX-416): remove WithMonitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-4chain committed Dec 21, 2023
1 parent e10bf6a commit c520da3
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 99 deletions.
19 changes: 0 additions & 19 deletions client_options.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package bux

import (
"context"
"database/sql"
"net/http"
"net/url"
Expand Down Expand Up @@ -633,24 +632,6 @@ func WithExcludedProviders(providers []string) ClientOps {
}
}

// WithMonitoring will create a new monitorConfig interface with the given options
func WithMonitoring(ctx context.Context, monitorOptions *chainstate.MonitorOptions) ClientOps {
return func(c *clientOptions) {
if monitorOptions != nil {
c.chainstate.options = append(c.chainstate.options, chainstate.WithMonitoring(ctx, monitorOptions))
}
}
}

// WithMonitoringInterface will set the interface to use for monitoring the blockchain
func WithMonitoringInterface(monitor chainstate.MonitorService) ClientOps {
return func(c *clientOptions) {
if monitor != nil {
c.chainstate.options = append(c.chainstate.options, chainstate.WithMonitoringInterface(monitor))
}
}
}

// -----------------------------------------------------------------
// NOTIFICATIONS
// -----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cron_job_declarations.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (c *Client) cronJobs() taskmanager.CronJobs {

return taskmanager.CronJobs{
CronJobNameDraftTransactionCleanUp: {
Period: defaultMonitorHeartbeat * time.Second,
Period: 60 * time.Second,
Handler: handler(taskCleanupDraftTransactions),
},
CronJobNameIncomingTransaction: {
Expand Down
1 change: 0 additions & 1 deletion definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const (
defaultDatabaseReadTimeout = 20 * time.Second // For all "GET" or "SELECT" methods
defaultDraftTxExpiresIn = 20 * time.Second // Default TTL for draft transactions
defaultHTTPTimeout = 20 * time.Second // Default timeout for HTTP requests
defaultMonitorHeartbeat = 60 // in Seconds (heartbeat for active monitor)
defaultMonitorSleep = 2 * time.Second
defaultMonitorLockTTL = 10 // in seconds - should be larger than defaultMonitorSleep
defaultOverheadSize = uint64(8) // 8 bytes is the default overhead in a transaction = 4 bytes version + 4 bytes nLockTime
Expand Down
78 changes: 0 additions & 78 deletions examples/client/monitor/monitor.go

This file was deleted.

0 comments on commit c520da3

Please sign in to comment.