Run exporter in goroutine

Use channel to pass data from exporter to importer
This commit is contained in:
Philipp Wolfer 2023-11-15 18:16:00 +01:00
parent 1ba165a631
commit 298697dcfc
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
7 changed files with 124 additions and 42 deletions

View file

@ -64,3 +64,31 @@ type Love struct {
RecordingMbid MBID
RecordingMsid MBID
}
type ListensList []Listen
func (l ListensList) Len() int {
return len(l)
}
func (l ListensList) Less(i, j int) bool {
return l[i].ListenedAt.Unix() < l[j].ListenedAt.Unix()
}
func (l ListensList) Swap(i, j int) {
l[i], l[j] = l[j], l[i]
}
type LovesList []Love
func (l LovesList) Len() int {
return len(l)
}
func (l LovesList) Less(i, j int) bool {
return l[i].Created.Unix() < l[j].Created.Unix()
}
func (l LovesList) Swap(i, j int) {
l[i], l[j] = l[j], l[i]
}