Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // BlockTime is estimated time needed to create a block in Ethereum. BlockTime = time.Second * 15 )
Functions ¶
func AutoOfferingPopUp ¶
func AutoOfferingPopUp(logger log.Logger, abi abi.ABI, db *reform.DB, ethBack eth.Backend, timeNowFunc func() time.Time, period uint) []*data.Job
AutoOfferingPopUp creates AgentPreOfferingPopUp jobs for active offerings. Taken into account a current balance of agent ETH. If ETH is not enough to pop up all offerings, then no one of them is popped up. Function calculates the pop up time.
func Loop ¶
func Loop(ctx context.Context, logger log.Logger, db *reform.DB, queue job.Queue, duration time.Duration, f func() []*data.Job)
Loop performs a function that creates new jobs with a certain frequency. If at the moment there is already a similar active job, then such job is ignored. The function works correctly only with jobs for which duplicates are allowed.
Types ¶
Click to show internal directories.
Click to hide internal directories.