|
From: creedon <icr...@us...> - 2006-02-19 02:53:44
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/rootUpdates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2501 Modified Files: getPendingUpdatesList Log Message: fixed problem with trying to check the category of an item that had already been deleted Index: getPendingUpdatesList =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/rootUpdates/getPendingUpdatesList,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** getPendingUpdatesList 31 Jan 2006 20:14:24 -0000 1.2 --- getPendingUpdatesList 19 Feb 2006 02:53:41 -0000 1.3 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.rootUpdates.getPendingUpdatesList ! on getPendingUpdatesList (adrUpdatesTable, rssUrl, databasesToUpdate, categories = nil) { ÇChanges Ç1/28/06; 7:21:26 PM by TAC Çadded categories parameter Çreplaced referrer url with baseUrl and ip information Ç8/5/04; 11:09:35 PM by JES ÇChange initial whenLastUpdatesRead date to 8/4/04. Ç12/17/03; 1:34:37 AM by JES ÇCreated. Read the RSS fead that lists pending root updates. local (flRead = false); if not defined (adrUpdatesTable^) { new (tableType, adrUpdatesTable)}; if not defined (adrUpdatesTable^.pendingUpdates) { new (tableType, @adrUpdatesTable^.pendingUpdates)}; if not defined (adrUpdatesTable^.whenLastUpdatesRead) { adrUpdatesTable^.whenLastUpdatesRead = date.set (4, 8, 2004, 0, 0, 0)}; if adrUpdatesTable^.whenLastUpdatesRead < date.yesterday (clock.now ()) { //read up to once every 24 hours flRead = true}; if flRead { //read the feature list RSS feed, and populate the pendingUpdates table adrUpdatesTable^.whenLastUpdatesRead = clock.now (); bundle { //read the updates into the pendingUpdates table local (services); new (tableType, @services); //a spoofed temporary services table new (tableType, @services.[rssUrl]); on storyArrivedCallback (adrservice, adrstory) { adrUpdatesTable^.pendingUpdates.[nameOf (adrstory^)] = adrstory^}; new (tableType, @adrUpdatesTable^.pendingUpdates); bundle { //read the RSS feed using xml.rss.readService xml.rss.readService (rssUrl, @services, config.mainresponder.prefs.baseUrl + "?ip=" + tcp.myDottedID (), @storyArrivedCallback, true)}}}; bundle { //delete any updates that we already have local (db, lastUpdate); for db in databasesToUpdate { //get lowest update date -- lowest common denominator try { local (adrprefs = @user.rootUpdates.servers.[db]); if typeOf (lastUpdate) == unknownType { lastUpdate = date (adrprefs^.lastUpdate)} else { if date (adrprefs^.lastUpdate) < lastUpdate { lastUpdate = date (adrprefs^.lastUpdate)}}}}; local (ctUpdates = sizeOf (adrUpdatesTable^.pendingUpdates), i); for i = ctUpdates downto 1 { //delete updates before lastUpdate or that don't match categories local (adr = @adrUpdatesTable^.pendingUpdates [i]); if date (adr^.data.pubDate) < lastUpdate { delete (adr)}; if typeOf (categories) == listType { local (fl = true, item); for item in categories { if adr^.catlist contains item { fl = false; break}}; if fl { delete (adr)}}}}; return (sizeOf (adrUpdatesTable^.pendingUpdates))} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.rootUpdates.getPendingUpdatesList ! on getPendingUpdatesList (adrUpdatesTable, rssUrl, databasesToUpdate, categories = nil) { ÇChanges Ç2/18/06; 6:03:07 PM by TAC Çfixed problem with trying to check the category of an item that had already been deleted Ç1/28/06; 7:21:26 PM by TAC Çadded categories parameter Çreplaced referrer url with baseUrl and ip information Ç8/5/04; 11:09:35 PM by JES ÇChange initial whenLastUpdatesRead date to 8/4/04. Ç12/17/03; 1:34:37 AM by JES ÇCreated. Read the RSS fead that lists pending root updates. local (flRead = false); if not defined (adrUpdatesTable^) { new (tableType, adrUpdatesTable)}; if not defined (adrUpdatesTable^.pendingUpdates) { new (tableType, @adrUpdatesTable^.pendingUpdates)}; if not defined (adrUpdatesTable^.whenLastUpdatesRead) { adrUpdatesTable^.whenLastUpdatesRead = date.set (4, 8, 2004, 0, 0, 0)}; if adrUpdatesTable^.whenLastUpdatesRead < date.yesterday (clock.now ()) { //read up to once every 24 hours flRead = true}; if flRead { //read the feature list RSS feed, and populate the pendingUpdates table adrUpdatesTable^.whenLastUpdatesRead = clock.now (); bundle { //read the updates into the pendingUpdates table local (services); new (tableType, @services); //a spoofed temporary services table new (tableType, @services.[rssUrl]); on storyArrivedCallback (adrservice, adrstory) { adrUpdatesTable^.pendingUpdates.[nameOf (adrstory^)] = adrstory^}; new (tableType, @adrUpdatesTable^.pendingUpdates); bundle { //read the RSS feed using xml.rss.readService xml.rss.readService (rssUrl, @services, config.mainresponder.prefs.baseUrl + "?ip=" + tcp.myDottedID (), @storyArrivedCallback, true)}}}; bundle { //delete any updates that we already have local (db, lastUpdate); for db in databasesToUpdate { //get lowest update date -- lowest common denominator try { local (adrprefs = @user.rootUpdates.servers.[db]); if typeOf (lastUpdate) == unknownType { lastUpdate = date (adrprefs^.lastUpdate)} else { if date (adrprefs^.lastUpdate) < lastUpdate { lastUpdate = date (adrprefs^.lastUpdate)}}}}; local (ctUpdates = sizeOf (adrUpdatesTable^.pendingUpdates), i, flDelete); for i = ctUpdates downto 1 { //delete updates before lastUpdate or that don't match categories local (adr = @adrUpdatesTable^.pendingUpdates [i]); if date (adr^.data.pubDate) < lastUpdate { delete (adr); continue}; if typeOf (categories) == listType { local (fl = true, item); for item in categories { if adr^.catlist contains item { fl = false; break}}; if fl { delete (adr)}}}}; return (sizeOf (adrUpdatesTable^.pendingUpdates))} \ No newline at end of file |