Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 301a2fa

Browse files
committed
Forgot to save solution before commit.
D'oh.
1 parent 25343a6 commit 301a2fa

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

src/GitHub.App/GitHub.App.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
<Compile Include="Services\StandardUserErrors.cs" />
189189
<Compile Include="Controllers\UIController.cs" />
190190
<Compile Include="Services\Translation.cs" />
191+
<Compile Include="Services\UsageTracker.cs" />
191192
<Compile Include="UserErrors\PublishRepositoryUserError.cs" />
192193
<Compile Include="UserErrors\PrivateRepositoryOnFreeAccountUserError.cs" />
193194
<Compile Include="UserErrors\PrivateRepositoryQuotaExceededUserError.cs" />

src/GitHub.App/Services/UsageTracker.cs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class UsageTracker : IUsageTracker
3131
readonly Lazy<IRepositoryHosts> repositoryHosts;
3232
//readonly Lazy<IAppVersionProvider> appVersionProvider;
3333
readonly Lazy<IEnvironment> environment;
34-
readonly Lazy<IRepositoryHosts> trackedRepositories;
34+
////readonly Lazy<IRepositoryHosts> trackedRepositories;
3535
readonly IPackageSettings userSettings;
3636

3737
// Whenever you add a counter make sure it gets added to _both_
@@ -228,15 +228,15 @@ IObservable<UsageModel> BuildUsageModel(bool weekly, bool monthly)
228228
model.Is64BitOperatingSystem = env.Is64BitOperatingSystem;
229229
model.Lang = CultureInfo.InstalledUICulture.IetfLanguageTag;
230230

231-
try
232-
{
233-
model.RamMB = (int)(env.GetTotalInstalledPhysicalMemory() / 1024 / 1024);
234-
}
235-
catch (Exception ex)
236-
{
237-
// This shouldn't really throw but let's be super defensive.
238-
log.Warn("Could not get total installed physical memory", ex);
239-
}
231+
////try
232+
////{
233+
//// model.RamMB = (int)(env.GetTotalInstalledPhysicalMemory() / 1024 / 1024);
234+
////}
235+
////catch (Exception ex)
236+
////{
237+
//// // This shouldn't really throw but let's be super defensive.
238+
//// log.Warn("Could not get total installed physical memory", ex);
239+
////}
240240

241241
try
242242
{
@@ -301,23 +301,22 @@ static bool IsOwner(IRepositoryModel repo, IRepositoryHosts hosts)
301301
////if (!repo.IsHosted || !repo.OwnerId.HasValue)
302302
//// return false;
303303

304-
if (hosts.GitHubHost != null && IsOwner(repo, hosts.GitHubHost))
305-
return true;
304+
////if (hosts.GitHubHost != null && IsOwner(repo, hosts.GitHubHost))
305+
//// return true;
306306

307-
if (hosts.EnterpriseHost != null && IsOwner(repo, hosts.EnterpriseHost))
308-
return true;
307+
////if (hosts.EnterpriseHost != null && IsOwner(repo, hosts.EnterpriseHost))
308+
//// return true;
309309

310310
return false;
311311
}
312312

313-
static bool IsOwner(IRepositoryModel repo, IRepositoryHost host)
314-
{
315-
throw new NotImplementedException();
316-
////Guard.ArgumentNotNull(repo, "repo");
317-
////Guard.ArgumentNotNull(host, "host");
313+
////static bool IsOwner(IRepositoryModel repo, IRepositoryHost host)
314+
////{
315+
//// Guard.ArgumentNotNull(repo, "repo");
316+
//// Guard.ArgumentNotNull(host, "host");
318317

319-
////return host.User != null && repo.OwnerId.HasValue && host.User.Id == repo.OwnerId.Value;
320-
}
318+
//// return host.User != null && repo.OwnerId.HasValue && host.User.Id == repo.OwnerId.Value;
319+
////}
321320

322321
IObservable<Unit> Run()
323322
{

src/GitHub.Exports.Reactive/GitHub.Exports.Reactive.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
<Compile Include="Models\UsageModel.cs" />
9191
<Compile Include="Services\IMetricsService.cs" />
9292
<Compile Include="Services\IModelService.cs" />
93+
<Compile Include="Services\IUsageTracker.cs" />
9394
<Compile Include="Services\NotificationDispatcher.cs" />
9495
<Compile Include="ViewModels\ILoginControlViewModel.cs" />
9596
<Compile Include="ViewModels\ILoginToGitHubForEnterpriseViewModel.cs" />

0 commit comments

Comments
 (0)