Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
save last activity timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-jmattson committed Aug 21, 2020
1 parent 0eb6bf2 commit f0305a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/TopoMojo.Core/Data/Stores/GamespaceStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ public GamespaceStore (

public override async Task<Gamespace> Add(Gamespace entity)
{

if (entity.Workspace != null)
{
entity.Workspace.LaunchCount += 1;

entity.Workspace.LastActivity = DateTime.UtcNow;
}

entity.LastActivity = DateTime.UtcNow;

var gamespace = await base.Add(entity);

return gamespace;
Expand Down
2 changes: 2 additions & 0 deletions src/TopoMojo.Core/Data/Stores/UserStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public async Task<bool> MemberOf(string globalId, Models.User user)
gamespace.LastActivity = DateTime.UtcNow;
}

await DbContext.SaveChangesAsync();

return result;
}

Expand Down
1 change: 0 additions & 1 deletion src/TopoMojo.Core/Services/GamespaceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public async Task<GameState> Launch(int workspaceId)
{
Name = workspace.Name,
Workspace = workspace,
LastActivity = DateTime.UtcNow,
ShareCode = Guid.NewGuid().ToString("N"),
Audience = "topomojo"
};
Expand Down

0 comments on commit f0305a2

Please sign in to comment.