Release 3X-UI for Docker / build (push) Canceled after 0s
Release 3X-UI / build (386) (push) Canceled after 0s
Release 3X-UI / build (amd64) (push) Canceled after 0s
Release 3X-UI / build (arm64) (push) Canceled after 0s
Release 3X-UI / build (armv5) (push) Canceled after 0s
Release 3X-UI / build (armv6) (push) Canceled after 0s
Release 3X-UI / build (armv7) (push) Canceled after 0s
Release 3X-UI / build (s390x) (push) Canceled after 0s
Release 3X-UI / Build for Windows (amd64) (push) Canceled after 0s
Release 3X-UI / Publish rolling dev release (push) Canceled after 0s
23 lines
633 B
Go
23 lines
633 B
Go
package job
|
|
|
|
import "github.com/mhsanaei/3x-ui/v3/internal/web/service/tgbot"
|
|
|
|
// CheckHashStorageJob periodically cleans up expired hash entries from the Telegram bot's hash storage.
|
|
type CheckHashStorageJob struct {
|
|
tgbotService tgbot.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() {
|
|
storage := j.tgbotService.GetHashStorage()
|
|
if storage == nil {
|
|
return
|
|
}
|
|
storage.RemoveExpiredHashes()
|
|
}
|