public void save_anonymous_users_solution()
		{
			var repo = new UserSolutionsRepo();
			var userSolution = repo.AddUserSolution("Linq", "0", "code", true, "", "output", null, null).Result;
			Console.WriteLine(userSolution.Id);
			repo.Delete(userSolution);
		}
示例#2
0
		public async Task<List<RunnerSubmission>> GetSubmissions([FromUri] string token, [FromUri] int count)
		{
			CheckRunner(token);
			var sw = Stopwatch.StartNew();
			while (true)
			{
				var repo = new UserSolutionsRepo();
				var exerciseCheckings = repo.GetUnhandledSubmissions(count);
				if (exerciseCheckings.Any() || sw.Elapsed > TimeSpan.FromSeconds(30))
				{
					return exerciseCheckings.Select(ToRunnerSubmition).ToList();
				}
				await repo.WaitUnhandled(TimeSpan.FromSeconds(10));
			}
		}