You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
659 B
26 lines
659 B
using Hangfire;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System;
|
|
|
|
namespace JobServer.Controllers
|
|
{
|
|
public class HomeController : Controller
|
|
{
|
|
public IActionResult Index(string id)
|
|
{
|
|
try
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(id))
|
|
{
|
|
RecurringJob.AddOrUpdate("test", () => Console.WriteLine(), id.Trim());
|
|
RecurringJob.RemoveIfExists("test");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ViewBag.Message = ex.ToString();
|
|
}
|
|
return View(model: id?.Trim());
|
|
}
|
|
}
|
|
} |