mirror of
https://github.com/luxfi/aml.git
synced 2026-09-24 00:25:20 +00:00
Lux Partners Limited is the Isle of Man company and does not appear on a public surface. Lux Industries Inc, a Delaware C corporation, is the one these copyright lines, citations and terms name. A bare "Lux Partners" is left alone unless the line says who owns something — elsewhere it is the name of a site, not a party.
30 lines
922 B
Go
30 lines
922 B
Go
// Copyright 2024-2026 Lux Industries Inc. All rights reserved.
|
|
// Use of this source code is governed by the Apache 2.0
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package retention
|
|
|
|
import (
|
|
"log"
|
|
"time"
|
|
|
|
"github.com/hanzoai/base/core"
|
|
)
|
|
|
|
// Cron registers the daily disposal at 03:30 UTC.
|
|
//
|
|
// A run that cannot prove what it destroyed reports nothing as disposed and logs
|
|
// the failure, and the next run tries again. Deletion is an obligation with a
|
|
// deadline measured in years, so a day of retries is safe where a false "done"
|
|
// is not.
|
|
func Cron(app core.App, l *Ledger) {
|
|
app.Cron().Add("aml-retention-dispose", "30 3 * * *", func() {
|
|
d, err := l.Dispose(time.Now().UTC())
|
|
if err != nil {
|
|
log.Printf("[aml-retention] disposal not proven, nothing reported as disposed: %v", err)
|
|
return
|
|
}
|
|
log.Printf("[aml-retention] examined %d records, disposed %d", d.Examined, len(d.Disposed))
|
|
})
|
|
}
|