Section One BBS

Welcome, Guest.


Subject: birthdaylist.js Date: Wed May 18 2022 12:09 pm
From: DesotoFireflite To: Digital Man

  Re: birthdaylist.js
  By: Digital Man to DesotoFireflite on Tue May 17 2022 02:51 pm

 DM> Re: birthdaylist.js
 DM> By: DesotoFireflite to Digital Man on Tue May 17 2022 04:15 pm

 > > DM>>> No immediate ideas. I probably start adding log() lines to
 > > DM>>> exec/birthdaylist.js and load/birthdays.js to find out exactly
 > > DM>>> where is locking or infinite-looping (more likely).

 > DM>> Okay, here's an example (to birthdaylist.js):

 > DM>> log("Loading birthdays.js"); // added
 > DM>> var list = load({}, "birthdays.js", month, day);
 > DM>> log("Loaded birthdays.js"); // added

 > DM>> So when run 'jsexec birthdaylist' here with those added log lines:

 > DM>> Reading script from /sbbs/exec/birthdaylist.js
 > DM>> /sbbs/exec/birthdaylist.js compiled in 0.00 seconds
 > DM>> Loading birthdays.js
 > DM>> Loaded birthdays.js
 > DM>> 45 Vertrauen users with birthdays in May:

 >> Ok, i put the log lines in as you suggested, and the problem seems to
 >> be in birthdays.js, as it tries to load birthdays.js then it locks up.
 >> see log output below. It never got to the second part.

 >> 5/17  03:47:39p  Node 1 <DesotoFireflite> Executing external:
 >> ?birthdaylist
 >> 5/17  03:47:39p  Node 1 <DesotoFireflite> Loading birthdays.js

 >> Seeing this, I tried to jsexec c:\sbbs\exec\load\birthdays.js, and it
 >> did the same thing, locked up, curser sits and spins.

 DM> Okay, but with birthdays.js runs correct, it's not going to display
 DM> anything to the console either. Best to just continue testing by invoking
 DM> birthdaylist.js. 

 >> I just don't understand why the program worked flawlessley for months
 >> on end, then stops on the 12th with a new user logs in. Also, I
 >> checked, windows did an update late on the 12th also, just discovered
 >> this today. 

 >> As always, thanks

 DM> The next step is to add some log() lines to load/birthdays.js and let me
 DM> know what's displayed before the hang:

 DM> function birthdays(month, day)
 DM> {
 DM> var u = new User;
 DM> log("getting total_users"); // added
 DM> var lastuser = system.stats.total_users;
 DM> log("got total_users: " + lastuser); // added
 DM> var list = [];
 DM> month = parseInt(month, 10) + 1;
 DM> for(u.number = 1; u.number <= lastuser; u.number++) {
 DM> if(u.settings&(USER_DELETED|USER_INACTIVE))
 DM> continue;
 DM> if(u.security.restrictions&(UFLAG_Q|UFLAG_G))
 DM> continue;
 DM> if(u.birthmonth != month)
 DM> continue;
 DM> if(day && u.birthday != day)
 DM> continue;
 DM> log("Adding to list: " + u.number); // added
 DM> list.push(u.number);
 DM> }
 DM> return list;
 DM> }

Heres what I get: I think we found the infinate loop you were talking
about (big sigh)

  5/18  11:51:23a  Node 1 <DesotoFireflite> Loading birthdays.js
  5/18  11:51:23a  Node 1 <DesotoFireflite> getting total_users
  5/18  11:51:23a  Node 1 <DesotoFireflite> got total_users: 286

This section below keeps repeating over and over the same thing till I shut down
 the system. It won't let me exit.

  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 249
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 265
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 270
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 12
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 37
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 39
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 41
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 42
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 60
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 84
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 91
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 109
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 129
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 146
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 170
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 175
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 197
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 202
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 203
  5/18  11:51:23a  Node 2 <DesotoFireflite> Adding to list: 211
  
 

SysOp: C.G. Learn, AKA: DesotoFireflite
Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com:23
A Gamers Paradise - Over 250 Registered Online Game Doors!

--- Don't eat the yellow snow!
 ■ SynchronetValhalla Home Services USA http://valhalla.synchro.net

No More Messages       Next Message
In Reply To: birthdaylist.js (Digital Man)
Replies: birthdaylist.js (Digital Man)