Couchbase.Management.BucketManager.ShouldRetryWatch C# (CSharp) Method

ShouldRetryWatch() private static method

private static ShouldRetryWatch ( IndexResult result, List indexNames ) : bool
result IndexResult
indexNames List
return bool
        private static bool ShouldRetryWatch(IndexResult result, List<string> indexNames)
        {
            if (!result.Success) // Return on server returned error
            {
                return false;
            }

            var indexes = result.Value.Where(index => indexNames.Contains(index.Name)).ToList();
            if (!indexes.Any()) // Didn't recognise any index names to watch
            {
                return false;
            }

            foreach (var index in indexes)
            {
                Log.DebugFormat("Index '{0}' is '{1}'", index.Name, index.State); // eg "Index 'foo' is 'online'"
            }

            return indexes.Any(index => index.State != "online");
        }