3x-ui/web/job/check_hash_storage.go

22 lines
611 B
Go
Raw Normal View History

package job
import (
2025-09-19 08:05:43 +00:00
"github.com/mhsanaei/3x-ui/v2/web/service"
)
2025-09-20 07:35:50 +00:00
// CheckHashStorageJob periodically cleans up expired hash entries from the Telegram bot's hash storage.
type CheckHashStorageJob struct {
tgbotService service.Tgbot
}
2025-09-20 07:35:50 +00:00
// NewCheckHashStorageJob creates a new hash storage cleanup job instance.
func NewCheckHashStorageJob() *CheckHashStorageJob {
return new(CheckHashStorageJob)
}
2025-09-20 07:35:50 +00:00
// 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()
}