private PackageUpdater GetInstance(string wikiId, bool create) { PackageUpdater instance; lock (_instances) { var entry = _instances[wikiId]; if (entry == null) { if (!create) { return(null); } var templatePath = string.Format(_packagePath, wikiId); if (!Directory.Exists(templatePath)) { throw new ArgumentException(string.Format("package path '{0}' does not exist", templatePath)); } instance = new PackageUpdater(templatePath); _instances.Set(wikiId, instance, _instanceTtl); } else { instance = entry.Value; } } return(instance); }
private PackageUpdater GetInstance(string wikiId, bool create) { PackageUpdater instance; lock(_instances) { var entry = _instances[wikiId]; if(entry == null) { if(!create) { return null; } var templatePath = string.Format(_packagePath, wikiId); if(!Directory.Exists(templatePath)) { throw new ArgumentException(string.Format("package path '{0}' does not exist", templatePath)); } instance = new PackageUpdater(templatePath); _instances.Set(wikiId, instance, _instanceTtl); } else { instance = entry.Value; } } return instance; }