mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-13 11:39:13 +00:00
21 lines
611 B
Go
21 lines
611 B
Go
package job
|
|
|
|
import (
|
|
"github.com/mhsanaei/3x-ui/v2/web/service"
|
|
)
|
|
|
|
// CheckHashStorageJob periodically cleans up expired hash entries from the Telegram bot's hash storage.
|
|
type CheckHashStorageJob struct {
|
|
tgbotService service.Tgbot
|
|
}
|
|
|
|
// NewCheckHashStorageJob creates a new hash storage cleanup job instance.
|
|
func NewCheckHashStorageJob() *CheckHashStorageJob {
|
|
return new(CheckHashStorageJob)
|
|
}
|
|
|
|
// Run removes expired hash entries from the Telegram bot's hash storage.
|
|
func (j *CheckHashStorageJob) Run() {
|
|
// Remove expired hashes from storage
|
|
j.tgbotService.GetHashStorage().RemoveExpiredHashes()
|
|
}
|