Created
October 12, 2012 21:36
-
-
Save corkupine/3881660 to your computer and use it in GitHub Desktop.
index creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IndexedRepo | |
{ | |
private IClient _client; | |
private static bool _indexCreated; | |
private static readonly object _locker = new object(); | |
public IndexedRepo(IClient client) | |
{ | |
this._client = client; | |
lock(_locker) | |
{ | |
if (!_indexCreated) {CreateIndex(client);} | |
} | |
} | |
private static void CreateIndex(IClient client) | |
{ | |
if (client.IndexExists("splorf") | |
{ | |
_indexCreated = true; | |
return; | |
} | |
//Do stuff to create index | |
_indexCreated = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment