code: func cleanupUnreferencedInvocations(c context.Context, invs []*Invocation) {
  	keysToKill := make([]*datastore.Key, 0, len(invs))
  	for _, inv := range invs {
  		if inv != nil {
  			logging.Warningf(c, "Cleaning up inv %d of job %q", inv.ID, inv.JobID)
  			keysToKill = append(keysToKill, datastore.KeyForObj(c, inv))
  		}
  	}
  	if err := datastore.Delete(datastore.WithoutTransaction(c), keysToKill); err != nil {
  		logging.WithError(err).Warningf(c, "Invocation cleanup failed")
  	}
  }
docs: // cleanupUnreferencedInvocations tries to delete given invocations.
  //
  // This is best effort cleanup after failures. It logs errors, but doesn't
  // return them, to indicate that there's nothing we can actually do.
  //
  // 'invs' is allowed to have nils, they are skipped. Allowed to be called
  // within a transaction, ignores it.