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

Commit

Permalink
tests(BUX-320): set sync interval to 15min, add action to force sync
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszos4chain committed Nov 28, 2023
1 parent ad09846 commit c931cca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions admin_actions_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ func (c *Client) GetStats(ctx context.Context, opts ...ModelOps) (*AdminStats, e
XPubs: xpubsCount,
}, nil
}

func (c *Client) ForceSync(ctx context.Context) error {
logClient := c.Logger()
logClient.Info(ctx, "FORCE running sync transaction(s) task...")
return taskSyncTransactions(ctx, c, WithClient(c))
}
4 changes: 2 additions & 2 deletions definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const (
taskIntervalMonitorCheck = defaultMonitorHeartbeat * time.Second // Default task time for cron jobs (seconds)
taskIntervalProcessIncomingTxs = 30 * time.Second // Default task time for cron jobs (seconds)
taskIntervalSyncActionBroadcast = 30 * time.Second // Default task time for cron jobs (seconds)
taskIntervalSyncActionSync = 120 * time.Second // Default task time for cron jobs (seconds)
taskIntervalTransactionCheck = 60 * time.Second // Default task time for cron jobs (seconds)
taskIntervalSyncActionSync = 900 * time.Second // Default task time for cron jobs (seconds)
taskIntervalTransactionCheck = 3000 * time.Second // Default task time for cron jobs (seconds)
)

// All the base models
Expand Down
2 changes: 2 additions & 0 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type AdminService interface {
conditions *map[string]interface{}, queryParams *datastore.QueryParams, opts ...ModelOps) ([]*Xpub, error)
GetXPubsCount(ctx context.Context, metadataConditions *Metadata,
conditions *map[string]interface{}, opts ...ModelOps) (int64, error)

ForceSync(ctx context.Context) error
}

// BlockHeaderService is the block header actions
Expand Down

0 comments on commit c931cca

Please sign in to comment.