|
37 | 37 | <outline text="*/"></outline> |
38 | 38 | </outline> |
39 | 39 | <outline text=""></outline> |
40 | | - <outline created="Mon, 03 Feb 2014 03:21:03 GMT" pgfnum="36831" text="var myVersion = "0.94t", myProductName = "nodeStorage"; "></outline> |
| 40 | + <outline created="Mon, 03 Feb 2014 03:21:03 GMT" pgfnum="36831" text="var myVersion = "0.94u", myProductName = "nodeStorage"; "></outline> |
41 | 41 | <outline created="Tue, 15 Apr 2014 20:31:53 GMT" pgfnum="40037" text=""></outline> |
42 | 42 | <outline created="Thu, 26 Dec 2013 23:02:58 GMT" pgfnum="34549" text="var http = require ("http"); "></outline> |
43 | 43 | <outline created="Tue, 21 Jan 2014 00:09:23 GMT" pgfnum="36074" text="var urlpack = require ("url");"></outline> |
|
582 | 582 | <outline text="}"></outline> |
583 | 583 | </outline> |
584 | 584 | <outline text="function loadStruct (fname, struct, callback) {"> |
| 585 | + <outline isComment="true" text="Changes"> |
| 586 | + <outline text="6/1/16; 10:06:14 AM by DW"> |
| 587 | + <outline text="Make the JSON.parse call in a try so an error in the stats file doesn't kill the server at startup. This seems to happen when the disk got full somehow so there will quite possibly be other problems. "></outline> |
| 588 | + </outline> |
| 589 | + </outline> |
585 | 590 | <outline created="Wed, 22 Jan 2014 23:07:46 GMT" pgfnum="36412" text="store.getObject (s3Path + fname, function (error, data) {"> |
586 | 591 | <outline text="if (!error) {"> |
587 | 592 | <outline created="Thu, 23 Jan 2014 18:37:27 GMT" pgfnum="36463" text="if (data != null) {"> |
588 | | - <outline created="Thu, 23 Jan 2014 16:59:39 GMT" pgfnum="36438" text="var oldStruct = JSON.parse (data.Body);"></outline> |
589 | | - <outline created="Sun, 27 Apr 2014 18:34:38 GMT" pgfnum="40531" text="for (var x in oldStruct) { "> |
590 | | - <outline created="Tue, 05 Nov 2013 16:12:39 GMT" pgfnum="30856" text="struct [x] = oldStruct [x];"></outline> |
591 | | - <outline created="Sun, 27 Apr 2014 18:36:17 GMT" pgfnum="40538" text="}"></outline> |
| 593 | + <outline text="try {"> |
| 594 | + <outline created="Thu, 23 Jan 2014 16:59:39 GMT" pgfnum="36438" text="var oldStruct = JSON.parse (data.Body);"></outline> |
| 595 | + <outline created="Sun, 27 Apr 2014 18:34:38 GMT" pgfnum="40531" text="for (var x in oldStruct) { "> |
| 596 | + <outline created="Tue, 05 Nov 2013 16:12:39 GMT" pgfnum="30856" text="struct [x] = oldStruct [x];"></outline> |
| 597 | + <outline created="Sun, 27 Apr 2014 18:36:17 GMT" pgfnum="40538" text="}"></outline> |
| 598 | + </outline> |
| 599 | + <outline text="}"></outline> |
| 600 | + </outline> |
| 601 | + <outline text="catch (err) {"> |
| 602 | + <outline text="console.log ("loadStruct: error reading file \"" + fname + "\", err.message == " + err.message + "\n");"></outline> |
| 603 | + <outline text="}"></outline> |
592 | 604 | </outline> |
593 | 605 | <outline created="Thu, 23 Jan 2014 18:37:33 GMT" pgfnum="36464" text="}"></outline> |
594 | 606 | </outline> |
|
624 | 636 | </outline> |
625 | 637 | <outline text="});"></outline> |
626 | 638 | </outline> |
627 | | - <outline created="Wed, 22 Jan 2014 23:07:46 GMT" isComment="true" pgfnum="36412" text="store.getObject (s3Path + fnameStats, function (error, data) { //5/18/14 by DW -- this changed, got a new <i>error</i> parameter. "> |
628 | | - <outline created="Thu, 23 Jan 2014 18:37:27 GMT" pgfnum="36463" text="if (data != null) {"> |
629 | | - <outline created="Thu, 23 Jan 2014 16:59:39 GMT" pgfnum="36438" text="var oldServerStats = JSON.parse (data.Body);"></outline> |
630 | | - <outline created="Sun, 27 Apr 2014 18:34:38 GMT" pgfnum="40531" text="for (var x in oldServerStats) { "> |
631 | | - <outline created="Sun, 27 Apr 2014 18:45:30 GMT" pgfnum="40540" text="if (x != "httpLog") {"> |
632 | | - <outline created="Tue, 05 Nov 2013 16:12:39 GMT" pgfnum="30856" text="serverStats [x] = oldServerStats [x];"></outline> |
633 | | - <outline created="Sun, 27 Apr 2014 18:45:38 GMT" pgfnum="40541" text="}"></outline> |
634 | | - </outline> |
635 | | - <outline created="Sun, 27 Apr 2014 18:36:17 GMT" pgfnum="40538" text="}"></outline> |
636 | | - </outline> |
637 | | - <outline created="Thu, 23 Jan 2014 18:37:33 GMT" pgfnum="36464" text="}"></outline> |
638 | | - </outline> |
639 | | - <outline created="Tue, 11 Feb 2014 22:44:56 GMT" pgfnum="37502" text="serverStats.ctHitsThisRun = 0;"></outline> |
640 | | - <outline created="Tue, 11 Feb 2014 22:44:56 GMT" pgfnum="37502" text="serverStats.ctTweetsThisRun = 0;"></outline> |
641 | | - <outline text="serverStats.whenServerStart = new Date ();"></outline> |
642 | | - <outline created="Mon, 28 Apr 2014 16:36:47 GMT" pgfnum="40619" text="serverStats.ctServerStarts++;"></outline> |
643 | | - <outline text="if (callback != undefined) {"> |
644 | | - <outline text="callback ();"></outline> |
645 | | - <outline text="}"></outline> |
646 | | - </outline> |
647 | | - <outline created="Wed, 22 Jan 2014 23:07:55 GMT" pgfnum="36413" text="});"></outline> |
648 | | - </outline> |
649 | 639 | <outline created="Tue, 11 Feb 2014 22:39:47 GMT" pgfnum="37500" text="}"></outline> |
650 | 640 | </outline> |
651 | 641 | <outline created="Sun, 27 Apr 2014 18:57:52 GMT" pgfnum="40558" text="function saveServerStats () {"> |
|
1681 | 1671 | <outline text="return (undefined); //didn't find the item"></outline> |
1682 | 1672 | <outline text="}"></outline> |
1683 | 1673 | </outline> |
| 1674 | + <outline text=""></outline> |
| 1675 | + <outline text=""></outline> |
| 1676 | + <outline text="function getMonthChatLogPosts (nameChatLog, monthnum, yearnum) { //5/31/16 by DW"> |
| 1677 | + <outline text="var theLog = findChatLog (nameChatLog), jstruct = new Array ();"></outline> |
| 1678 | + <outline text="if (theLog === undefined) {"> |
| 1679 | + <outline text="return (undefined);"></outline> |
| 1680 | + <outline text="}"></outline> |
| 1681 | + </outline> |
| 1682 | + <outline text=""></outline> |
| 1683 | + <outline text="var theMonth = new Date ();"></outline> |
| 1684 | + <outline text="theMonth.setSeconds (0);"></outline> |
| 1685 | + <outline text="theMonth.setMinutes (0);"></outline> |
| 1686 | + <outline text="theMonth.setHours (0);"></outline> |
| 1687 | + <outline text="theMonth.setDate (1);"></outline> |
| 1688 | + <outline text="theMonth.setMonth (monthnum);"></outline> |
| 1689 | + <outline text="theMonth.setFullYear (yearnum);"></outline> |
| 1690 | + <outline text=""></outline> |
| 1691 | + <outline text="for (var i = 0; i < theLog.chatLog.length; i++) {"> |
| 1692 | + <outline text="if (utils.sameMonth (new Date (theLog.chatLog [i].when), theMonth)) {"> |
| 1693 | + <outline text="jstruct [jstruct.length] = theLog.chatLog [i];"></outline> |
| 1694 | + <outline text="}"></outline> |
| 1695 | + </outline> |
| 1696 | + <outline text="}"></outline> |
| 1697 | + </outline> |
| 1698 | + <outline text=""></outline> |
| 1699 | + <outline text="return (jstruct);"></outline> |
| 1700 | + <outline text="}"></outline> |
| 1701 | + </outline> |
| 1702 | + <outline text=""></outline> |
| 1703 | + <outline text=""></outline> |
1684 | 1704 | <outline text="function getChatLogIndex (nameChatLog) { //1/2/16 by DW"> |
1685 | 1705 | <outline isComment="true" text="Changes"> |
1686 | 1706 | <outline text="5/6/16; 11:16:50 AM by DW"> |
|
4671 | 4691 | <outline text="break;"></outline> |
4672 | 4692 | </outline> |
4673 | 4693 | <outline text="case "/getchatmessage": //9/20/15 by DW"> |
4674 | | - <outline text="var nameChatLog = parsedUrl.query.chatLog; //10/26/15 by DW -- yyy"></outline> |
| 4694 | + <outline text="var nameChatLog = parsedUrl.query.chatLog; //10/26/15 by DW"></outline> |
4675 | 4695 | <outline text="findChatMessage (nameChatLog, parsedUrl.query.id, function (flFound, item, subs, theTopItem) {"> |
4676 | 4696 | <outline text="if (flFound) {"> |
4677 | 4697 | <outline created="Sat, 21 Jun 2014 14:43:33 GMT" pgfnum="42366" text="dataResponse ({"> |
|
4914 | 4934 | <outline created="Wed, 22 Jan 2014 15:18:30 GMT" pgfnum="36266" text="break;"></outline> |
4915 | 4935 | </outline> |
4916 | 4936 | <outline text=""></outline> |
| 4937 | + <outline text="case "/getmonthchatmessages": //5/31/16 by DW"> |
| 4938 | + <outline text="var monthnum = parsedUrl.query.monthnum;"></outline> |
| 4939 | + <outline text="var yearnum = parsedUrl.query.yearnum;"></outline> |
| 4940 | + <outline text="var nameChatLog = parsedUrl.query.chatLog; "></outline> |
| 4941 | + <outline isComment="true" text=""></outline> |
| 4942 | + <outline isComment="true" text="console.log ("/getmonthchatmessages: monthnum == " + monthnum + ", yearnum == " + yearnum + ", nameChatLog == " + nameChatLog);"></outline> |
| 4943 | + <outline text=""></outline> |
| 4944 | + <outline text="var jstruct = getMonthChatLogPosts (nameChatLog, monthnum, yearnum);"></outline> |
| 4945 | + <outline text="if (jstruct === undefined) {"> |
| 4946 | + <outline text="errorResponse ({message: "Can't get chatlog items for month # " + monthnum + " in " + yearnum + " because the chatlog doesn't exist or the posts don't."});"></outline> |
| 4947 | + <outline text="}"></outline> |
| 4948 | + </outline> |
| 4949 | + <outline text="else {"> |
| 4950 | + <outline created="Thu, 26 Jun 2014 12:29:46 GMT" pgfnum="42486" text="dataResponse (jstruct);"></outline> |
| 4951 | + <outline text="}"></outline> |
| 4952 | + </outline> |
| 4953 | + <outline text=""></outline> |
| 4954 | + <outline text="break;"></outline> |
| 4955 | + </outline> |
| 4956 | + <outline text=""></outline> |
4917 | 4957 | <outline isComment="true" text="case "/test1": //10/27/15 by DW"> |
4918 | 4958 | <outline text="postChatMessage ("davewiner", "blork", "Oh the buzzing of the bees", undefined, undefined, undefined, undefined, true, function (err, idMessage) {"> |
4919 | 4959 | <outline text="if (err) {"> |
|
0 commit comments