Thursday, April 07, 2011 at 10:00 AM.

system.verbs.builtins.opmlEditor.everyMinute

on everyMinute () {
	<<Changes
		<<4/7/11; 8:18:19 AM by DW
			<<If enabled, update open tools.
		<<3/29/11; 11:38:16 AM by DW
			<<Maintenence flag to upgrade to scheduler2.
		<<9/18/10; 8:33:32 AM by DW
			<<Call opmlEditor.loadPartsFromFolder every minute.
		<<1/18/10; 11:23:13 AM by DW
			<<Maintenence check, if config.mainResponder.prefs.flSaveDatabasesEveryMinute is true, set it false. We don't need two bits saving the databases every minute. 
		<<12/28/09; 8:27:33 AM by DW
			<<Call opmlEditor.runScriptsFolder every minute.
		<<10/31/09; 11:42:39 AM by DW
			<<Maintenence flag -- Fix config.mainresponder.domains.default and delete websiteframework pointers to tables that don't exist.
		<<9/18/09; 9:41:14 AM by DW
			<<Maintenence flag -- Set user.prefs.flMainResponderHandlesErrors true, for standard of web server error handling.
		<<9/17/09; 7:26:30 AM by DW
			<<Use opmlEditor.updateMainRoot to update opml.root.
		<<8/16/08; 10:37:14 PM by DW
			<<Add maintenence scripts section.
		<<8/4/08; 6:04:02 AM by DW
			<<Fixed error -- we were setting lastUpdate in the top-level of user.opmlEditor instead of in the stats table.
		<<8/2/08; 8:05:03 PM by DW
			<<Update tools that registered in addition to opml.root.
		<<8/2/08; 12:16:26 PM by DW
			<<Nightly updates for opml.root.
		<<7/30/08; 9:50:52 AM by DW
			<<Code that runs once every minute.
	opmlEditor.init ();
	user.opmlEditor.stats.ctEveryMinutes++; //12/28/09 by DW
	opmlEditor.runScriptsFolder (); //12/28/09 by DW
	opmlEditor.loadPartsFromFolder (); //9/18/10 by DW
	if user.opmlEditor.prefs.flNightlyUpdate {
		local (now = clock.now ());
		if date.hour (now) == user.opmlEditor.prefs.hourToUpdate {
			if not date.sameday (now, user.opmlEditor.stats.whenLastUpdate) { //time to do the update
				user.opmlEditor.stats.whenLastUpdate = now; filemenu.save ();
				opmlEditor.updateMainRoot (); //9/17/09 by DW
				opmlEditor.updateTools (); //8/2/08 by DW
				if user.opmlEditor.prefs.flUpdateOpenTools { //4/7/11 by DW
					opmlEditor.updateOpenTools ()}}}};
	bundle { //maintenence checks
		if not defined (user.opmlEditor.flags.cleanupGuestDatabasesFolder) {
			try {opmlEditor.maintenence.cleanupGdbFolder ()};
			user.opmlEditor.flags.cleanupGuestDatabasesFolder = clock.now ()};
		if not defined (user.opmlEditor.flags.betterWebServerErrorHandling) { //9/18/09 by DW
			user.prefs.flMainResponderHandlesErrors = true; //see comment in mainresponder.respond
			user.opmlEditor.flags.betterWebServerErrorHandling = clock.now ()};
		if not defined (user.opmlEditor.flags.fixShipShopPaths) { //10/31/09 by DW
			try {opmlEditor.maintenence.fixShipShopPaths ()};
			user.opmlEditor.flags.fixShipShopPaths = clock.now ()};
		if not defined (user.opmlEditor.flags.fixSaveDatabases) { //1/18/10 by DW
			try {
				if config.mainResponder.prefs.flSaveDatabasesEveryMinute {
					config.mainResponder.prefs.flSaveDatabasesEveryMinute = false}};
			user.opmlEditor.flags.fixSaveDatabases = clock.now ()};
		if not defined (user.opmlEditor.flags.upgradeToScheduler2) { //3/29/11 by DW
			user.tools.prefs.flUseScheduler2 = true;
			user.opmlEditor.flags.upgradeToScheduler2 = clock.now ()}}};
bundle { //test code
	everyMinute ()}



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.