add exec
This commit is contained in:
@@ -104,13 +104,13 @@ func (d *WorkflowExecutions) VerifyAuth(request *tools.APIRequest) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (d *WorkflowExecutions) Book(priceds map[tools.DataType][]pricing.PricedItemITF) []*booking.Booking {
|
||||
booking := d.bookEach(tools.STORAGE_RESOURCE, priceds[tools.STORAGE_RESOURCE])
|
||||
booking = append(booking, d.bookEach(tools.PROCESSING_RESOURCE, priceds[tools.PROCESSING_RESOURCE])...)
|
||||
func (d *WorkflowExecutions) Book(wfID string, priceds map[tools.DataType][]pricing.PricedItemITF) []*booking.Booking {
|
||||
booking := d.bookEach(wfID, tools.STORAGE_RESOURCE, priceds[tools.STORAGE_RESOURCE])
|
||||
booking = append(booking, d.bookEach(wfID, tools.PROCESSING_RESOURCE, priceds[tools.PROCESSING_RESOURCE])...)
|
||||
return booking
|
||||
}
|
||||
|
||||
func (d *WorkflowExecutions) bookEach(dt tools.DataType, priceds []pricing.PricedItemITF) []*booking.Booking {
|
||||
func (d *WorkflowExecutions) bookEach(wfID string, dt tools.DataType, priceds []pricing.PricedItemITF) []*booking.Booking {
|
||||
items := []*booking.Booking{}
|
||||
for _, priced := range priceds {
|
||||
start := d.ExecDate
|
||||
@@ -123,6 +123,7 @@ func (d *WorkflowExecutions) bookEach(dt tools.DataType, priceds []pricing.Price
|
||||
ResourceID: priced.GetID(),
|
||||
ResourceType: dt,
|
||||
DestPeerID: priced.GetCreatorID(),
|
||||
WorkflowID: wfID,
|
||||
ExecutionID: d.GetID(),
|
||||
ExpectedStartDate: start,
|
||||
ExpectedEndDate: &end,
|
||||
|
@@ -71,7 +71,7 @@ func (ws *WorkflowSchedule) CheckBooking(wfID string, request *tools.APIRequest)
|
||||
return false, wf, []*WorkflowExecutions{}, err
|
||||
}
|
||||
for _, exec := range execs {
|
||||
bookings := exec.Book(priceds)
|
||||
bookings := exec.Book(wfID, priceds)
|
||||
for _, booking := range bookings {
|
||||
_, err := (&peer.Peer{}).LaunchPeerExecution(booking.DestPeerID, "",
|
||||
tools.BOOKING, tools.POSTCHECK, booking.Serialize(booking), request.Caller)
|
||||
|
Reference in New Issue
Block a user