Friday, September 17, 2010 at 1:46 PM.

river2Suite.everyMinute

<<Changes
	<<6/22/10; 11:07:04 AM by DW
		<<We broke the process for releasing Rebooting the News. If River2 read the feed while the post was public but didn't have the MP3 linked in, then the user didn't get yesterday's show. Simple fix, remove the history element for the podcast if it's defined, so the item will be read again and this time the podcast should be downloaded.
	<<5/4/10; 12:17:43 PM by DW
		<<A maintenence flag to undo the initialization of adrdata^.prefs.static.flJavaScriptInclude.
	<<3/19/10; 8:21:26 AM by DW
		<<A maintenence flag that corrects a mistake in updating the Prefs outline.
			<<http://river2.org/2010/03/19/how-to-update-the-prefs-outline-in-river2/
	<<12/25/09; 11:11:11 AM by DW
		<<Launch the cloudPipeClient thread if it's enabled.
	<<12/21/09; 4:14:45 AM by DW
		<<New maintenence flag, clean up the announcements structure.
	<<9/16/09; 7:01:24 PM by DW
		<<This script moves from the background table to the top level of the river2 suite. It's now called by scheduler2, which is much more robust than the first scheduler.
	<<9/9/09; 7:34:33 AM by DW
		<<Add a flag that controls whether we check the enclosure download queues. This helps with debugging. (I turn it off when I don't want them to download right now, like turning off the Bay Bridge over Labor Day weekend.)
	<<9/8/09; 1:45:09 PM by DW
		<<Check all enclosure queues.
	<<9/2/09; 10:25:50 AM by DW
		<<maxMegsFix maintenence.
	<<8/24/09; 9:02:28 PM by DW
		<<Check if any podcasts are ready to download.
	<<8/16/09; 6:58:18 PM by DW
		<<Add maintenence checks bundle.
	<<6/16/09; 2:04:06 PM by DW
		<<Created. 
local (adrdata = river2suite.init (), now = clock.now ());
<<if adrdata^.prefs.flEnclosureDownloadEnabled //check download queues, 9/9/09 by DW
	<<local (adrcal)
	<<for adrcal in @adrdata^.enclosures
		<<river2Suite.podcasts.checkQueue (adrcal)
if adrdata^.prefs.enabled {
	local (flscan = false);
	if adrdata^.stats.whenLastScanStart == date (0) {
		flscan = true};
	local (ctmin = number (clock.now () - adrdata^.stats.whenLastScanStart) / 60);
	if ctmin >= adrdata^.prefs.minutesBetweenScans {
		flscan = true};
	if flscan {
		river2Suite.doScanNow ()};
	adrdata^.stats.ctEveryMinutes++};
bundle { //launch the cloudPipeClient thread if it's enabled, 12/25/09 by DW
	if adrdata^.prefs.cloudPipeClient.enabled {
		local (fllaunch = true);
		if defined (system.temp.river2.idCloudPipeClient) {
			if thread.exists (system.temp.river2.idCloudPipeClient) {
				fllaunch = false}};
		if fllaunch {
			system.temp.river2.idCloudPipeClient = thread.callscript (@river2Suite.cloudPipe.client, {})}}
	else {
		if defined (system.temp.river2.idCloudPipeClient) {
			delete (@system.temp.river2.idCloudPipeClient)}}};
bundle { //maintenence checks
	if not defined (adrdata^.flags.maxMegsFix) { //9/2/09 by DW
		if defined (adrdata^.prefs.maxFolderMegs) {
			delete (@adrdata^.prefs.maxFolderMegs)};
		adrdata^.flags.maxMegsFix = now};
	if not defined (adrdata^.flags.readingListStartup) {
		local (adrfeed);
		for adrfeed in @adrdata^.feeds { //all existing feeds are not from reading lists
			adrfeed^.prefs.flNonListSubscribe = true};
		adrdata^.flags.readingListStartup = now};
	if not defined (adrdata^.flags.moveEveryMinute) { //9/16/09 by DW
		try {delete (@river2Suite.background.everyMinute)};
		adrdata^.flags.moveEveryMinute = now};
	if not defined (adrdata^.flags.cleanUpAnnouncements) { //12/21/09 by DW
		try {delete (@river2Suite.data.announcement)};
		try {delete (@river2Suite.data.announcementArchive)};
		adrdata^.flags.cleanUpAnnouncements = now};
	if not defined (adrdata^.flags.correctRiver2Prefs) { //3/19/10 by DW
		local (addresslist = string.parseaddress (this), f = addresslist [1], adrprefs = @[f].["#installer"].prefs);
		if defined (adrprefs^) {
			delete (adrprefs)};
		adrprefs^ = "river2Suite.data.prefsOutline";
		adrdata^.flags.correctRiver2Prefs = now};
	if not defined (adrdata^.flags.deleteStaticJsPref) { //5/4/10 by DW
		try {delete (@adrdata^.prefs.static.flJavaScriptInclude)};
		adrdata^.flags.deleteStaticJsPref = now};
	if not defined (adrdata^.flags.fixMissingRebootNewsPodcast) { //6/22/10 by DW
		try {delete (@adrdata^.feeds.["http://rebootnews.com/feed/"].history.["http://rebootnews.com/?p=443"])};
		adrdata^.flags.fixMissingRebootNewsPodcast = now}}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.