Re: birthdaylist.js
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.
Okay, but with birthdays.js runs correct, it's not going to display anything to
the console either. Best to just continue testing by invoking 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
The next step is to add some log() lines to load/birthdays.js and let me know wh
at's displayed before the hang:
function birthdays(month, day)
{
var u = new User;
log("getting total_users"); // added
var lastuser = system.stats.total_users;
log("got total_users: " + lastuser); // added
var list = [];
month = parseInt(month, 10) + 1;
for(u.number = 1; u.number <= lastuser; u.number++) {
if(u.settings&(USER_DELETED|USER_INACTIVE))
continue;
if(u.security.restrictions&(UFLAG_Q|UFLAG_G))
continue;
if(u.birthmonth != month)
continue;
if(day && u.birthday != day)
continue;
log("Adding to list: " + u.number); // added
list.push(u.number);
}
return list;
}
--
digital man (rob)
Synchronet/BBS Terminology Definition #56:
NUP = New User Password
Norco, CA WX: 73.3°F, 52.0% humidity, 11 mph SSE wind, 0.00 inches rain/24hrs
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
|