//Flush deletes all the data in the cache
Flush deletes all the data in the cache
// Flush deletes all the data in the cache
func (c *CacheService) Flush(ctx context.Context, req *empty.Empty) (*cache.FlushResponse, error) {
	c.mutex.Lock()
	defer c.mutex.Unlock()
	if len(c.store) < 1 {
		return &cache.FlushResponse{Ok: false}, status.Errorf(codes.Aborted, "store is already empty")
	}
	log.Printf("flushing the store\n")
	c.store = make(map[string][]byte)
	return &cache.FlushResponse{Ok: true}, nil
}
func ( c * CacheService ) Flush ( ctx context . Context , req * empty . Empty ) ( * cache . FlushResponse , error ) { c . mutex . Lock ( ) defer c . mutex . Unlock ( ) if len ( c . store ) < 1 { return & cache . FlushResponse { Ok : false } , status . Errorf ( codes . Aborted , " " ) } log . Printf ( " \n " ) c . store = make ( map [ string ] [ ] byte ) return & cache . FlushResponse { Ok : true } , nil }
Flush deletes all the data in the cache
Flush deletes all the data in the cache