Archived
1
0
Fork 0

dlight.c: Mark item in download history earlier.

It is more correct to mark an item as downloaded right after
it is actually fetched and not after it is successfully written to disk.
This commit is contained in:
Henrik Hautakoski 2012-06-28 17:02:14 +02:00
parent 365b657f9f
commit d49b1b2456

View file

@ -53,14 +53,16 @@ static void process_items(rss_t rss, struct target *t) {
} }
} }
/* save file to disk. */ /* At this point, mark the item as downloaded.
Even if we encounter an error while saving to disk. */
dlhist_mark(item.title, filter->dest);
if (write_http_file(file, filter->dest) < 0) if (write_http_file(file, filter->dest) < 0)
continue; continue;
printf("Downloaded: %s (%s) to %s\n", printf("Downloaded: %s (%s) to %s\n",
item.title, item.link, filter->dest); item.title, item.link, filter->dest);
dlhist_mark(item.title, filter->dest);
proc_cache_update(item.link); proc_cache_update(item.link);
} }