code: func (o *opsCache) Do(c context.Context, key string, cb func() error) error {
  	// Check the local cache.
  	if o.getFlag(key) {
  		return nil
  	}
  
  	// Check the global cache.
  	switch _, err := memcache.GetKey(c, key); {
  	case err == nil:
  		o.setFlag(key)
  		return nil
  	case err == memcache.ErrCacheMiss:
  		break
  	default:
  		logging.WithError(err).Warningf(c, "opsCache failed to check memcache, will proceed executing op")
  	}
  
  	// Do it.
  	if err := cb(); err != nil {
  		return err
  	}
  
  	// Store in the local cache.
  	o.setFlag(key)
  
  	// Store in the global cache. Ignore errors, it's not a big deal.
  	item := memcache.NewItem(c, key)
  	item.SetValue([]byte("ok"))
  	item.SetExpiration(24 * time.Hour)
  	if err := memcache.Set(c, item); err != nil {
  		logging.WithError(err).Warningf(c, "opsCache failed to write item to memcache")
  	}
  
  	return nil
  }
docs: // Do calls callback only if it wasn't called before.
  //
  // Works on best effort basis: callback can and will be called multiple times
  // (just not the every time 'Do' is called).
  //
  // Keeps "done" flag in local memory and in memcache (using 'key' as
  // identifier). The callback should be idempotent, since it still may be called
  // multiple times if multiple processes attempt to execute the action at once.