reconcile java with latest patterns

This commit is contained in:
Mahmood Ali
2018-11-06 12:49:29 -08:00
parent 12149c3804
commit 62d24ce9ef
2 changed files with 12 additions and 4 deletions

View File

@@ -171,9 +171,9 @@ func (d *Driver) Capabilities() (*drivers.Capabilities, error) {
return capabilities, nil
}
func (r *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error) {
func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error) {
ch := make(chan *drivers.Fingerprint)
go r.handleFingerprint(ctx, ch)
go d.handleFingerprint(ctx, ch)
return ch, nil
}
@@ -241,7 +241,16 @@ func (d *Driver) buildFingerprint() *drivers.Fingerprint {
func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error {
if handle == nil {
return fmt.Errorf("error: handle cannot be nil")
return fmt.Errorf("handle cannot be nil")
}
// If already attached to handle there's nothing to recover.
if _, ok := d.tasks.Get(handle.Config.ID); ok {
d.logger.Debug("nothing to recover; task already exists",
"task_id", handle.Config.ID,
"task_name", handle.Config.Name,
)
return nil
}
var taskState TaskState