fixed behaviour in case failed retrieval (#15)

This commit is contained in:
kitzman 2021-07-11 20:36:36 +03:00
parent a312e0f37e
commit b051fedcfd
Signed by: kitzman
GPG Key ID: 83289D84AA7C9A54
2 changed files with 6 additions and 8 deletions

View File

@ -93,7 +93,7 @@
conf
(filter
(match-lambda
((conf-entry news-item)
((conf-entry news-items)
(eq? (config-entry-type conf-entry) feed-type))
(_ #f))
pair-entries)

View File

@ -74,17 +74,15 @@
(retrieved-data (and<= retrieval-fn config-entry))
(parsed-entries (and<=> parse-fn retrieved-data))
(new-items (if (equal? retrieved-data #f)
'()
'()
(database-insert-entries!
db conf config-entry parsed-entries))))
(if (or (eq? retrieval-fn #f) (eq? parse-fn #f))
(begin
(format #t "unable to find the configured feed type!\n")
#f)
(if (eq? retrieved-data #f)
(begin
(begin
(if (eq? retrieved-data #f)
(format #t "failed to retrieve data!\n")
#f)
(begin
(format #t "new items: ~a\n" (length new-items))
`(,config-entry ,new-items))))))
(format #t "new items: ~a\n" (length new-items)))
`(,config-entry ,new-items)))))