Added start of db rework, also added Qol changes

This commit is contained in:
Pablu23
2024-04-02 16:35:50 +02:00
parent 1377fd420e
commit ce878efce3
7 changed files with 211 additions and 22 deletions

View File

@@ -61,6 +61,17 @@ func (s *Server) Start() error {
// Update Latest Chapter every 5 Minutes
go func(s *Server) {
time.AfterFunc(time.Second*10, func() {
s.DbMgr.Rw.Lock()
for _, m := range s.DbMgr.Mangas {
err := s.UpdateLatestAvailableChapter(m)
if err != nil {
fmt.Println(err)
}
}
s.DbMgr.Rw.Unlock()
})
for {
select {
case <-time.After(time.Minute * 5):