From b6de09f2a329fb071dd7b6383326638cf8893ba2 Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Sat, 4 Oct 2014 12:48:45 +0100 Subject: [PATCH] Added databse handler to New() so that it functionally identical to old approach --- feed.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/feed.go b/feed.go index 7950172..769ea87 100644 --- a/feed.go +++ b/feed.go @@ -117,12 +117,15 @@ type Feed struct { } // New is a helper function to stay semi-compatible with -// the old code +// the old code. Includes the databse handler to ensure +// that this approach is functionally identical to the +// old databse/handlers version func New(cachetimeout int, enforcecachelimit bool, ch ChannelHandlerFunc, ih ItemHandlerFunc) *Feed { - return NewWithHandler(cachetimeout, enforcecachelimit, NewHandlerBonder(ch, ih)) + return NewWithHandler(cachetimeout, enforcecachelimit, NewDatabaseHandler(NewHandlerBonder(ch, ih))) } // NewWithHandler creates a new feed with a handler +// People should use this appraoch from now on func NewWithHandler(cachetimeout int, enforcecachelimit bool, h Handler) *Feed { v := new(Feed) v.CacheTimeout = cachetimeout