mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-31 07:09:50 +02:00
Add peer expiration
This commit is contained in:
parent
2d67540e13
commit
2ecb92eef6
94 changed files with 43258 additions and 49 deletions
20
Application/Services/HangfireManager.cs
Normal file
20
Application/Services/HangfireManager.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using Hangfire;
|
||||
using Hangfire.Storage;
|
||||
using MTWireGuard.Application.Repositories;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MTWireGuard.Application.Services
|
||||
{
|
||||
public class HangfireManager
|
||||
{
|
||||
public static int SetUserExpiration(int userID, DateTime expireDate)
|
||||
{
|
||||
return int.Parse(BackgroundJob.Schedule<IMikrotikRepository>(mikrotik => mikrotik.DisableUser(userID), expireDate));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue