Skip to content

Commit c599a12

Browse files
committed
Changes default offloading policy
1 parent 2e63598 commit c599a12

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

internal/workflow/offloading_policy.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ type OffloadingPolicy interface {
99
Evaluate(r *Request, p *Progress) (OffloadingDecision, error)
1010
}
1111

12+
type NoOffloadingPolicy struct{}
13+
14+
func (policy *NoOffloadingPolicy) Evaluate(r *Request, p *Progress) (OffloadingDecision, error) {
15+
16+
return OffloadingDecision{Offload: false}, nil
17+
}
18+
1219
type SimpleOffloadingPolicy struct{}
1320

1421
func (policy *SimpleOffloadingPolicy) Evaluate(r *Request, p *Progress) (OffloadingDecision, error) {

internal/workflow/workflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/serverledge-faas/serverledge/internal/types"
2121
)
2222

23-
var offloadingPolicy OffloadingPolicy = &SimpleOffloadingPolicy{} // TODO: handle initialization elsewhere
23+
var offloadingPolicy OffloadingPolicy = &NoOffloadingPolicy{} // TODO: handle initialization elsewhere
2424

2525
// Workflow is a Workflow to drive the execution of the workflow
2626
type Workflow struct {

0 commit comments

Comments
 (0)