Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

nph-build problem -- abort or looping

(Page 2 of 2)
> >
Quote Reply
to Alex In reply to
Hi Alex!

Thank you for your help, but the same problem still exists. LinksSQL is building the categories and the links, but only to about half the categories. After that the building process stops. Without error message or so. What's wrong? The more links I have (about 10.000) the lesser categories are build. Do you know a solution? Quite a problem, for the site is now online and visitors can't surf through the non-build-categories.

Quote Reply
Re: to Alex In reply to
The problem could be related to having more than 1000 links in some of your categories. You should notice that within the sub build_category_pages, a LIMIT is set to 1000 links per category. If the number of links in the category exceeds 1000, then that category won't build.

Solution:

1) Create additional sub-categories to break up your links.

OR

2) Delete all the LIMIT codes or change the 1000 to a higher number like 5000.

Regards,

Eliot Lee

Quote Reply
Re: to Alex In reply to
That does not seem to be the problem, I don't have more than 1000 Links in one category. But I tried to set the limit to 5000, but the building process stops again.

Isn't there a possibility to have a build-staggered option, where I can - such as links 2.0 - give the number of categories to be build within steps? Or to build the categories starting with the last of them.

I don't really have a clue......

Quote Reply
Re: to Alex In reply to
In Reply To:
Isn't there a possibility to have a build-staggered option, where I can - such as links 2.0 - give the number of categories to be build within steps? Or to build the categories starting with the last of them.
In the next version of Links SQL - most definitely. In the current version of Links SQL - most definitely NOT without a lot of hacking and basically trashing the current build script and writing a new one.

Regards,

Eliot Lee

Quote Reply
Re: nph-build problem -- abort or looping In reply to
Thanks, Alex. But your suggested way does not work, sorry. What will happen, if I do it in the first way, to ### the three lines and - hope so - kill the loop? Problems with my ISP, really?

Nothing seems to work, so. I do really need a working nph-build.cgi, my visitors are now quite annoyed. Don't you know a way? Could you send me a working nph-build.cgi? Please, please, help...

Quote Reply
Re: nph-build problem -- abort or looping In reply to
Ok,

You can sort of fudge things if you can build via telnet.

Code:
&build_backup();
&build_update_counters();
&build_update_newpop();
&build_stats();
&build_detailed_view();
&build_home_page();
&build_new_page();
&build_cool_page();
&build_rate_page();
&build_category_pages();
If you've run an aborted build, where you at least started the category
pages, you can put a # in front of each of the subroutines above, and try running _just_ the &build_category_pages()

next time you run the nph-build, don't forget to uncomment (doing right after you run this is a good idea) the lines above, since if you don't &build_stats() you wont update anything, and you won't build properly.

None of the routines are dependent upon one another, but should be built in order. You can save some time, maybe squeeze out a few more categories by doing that.

But, if you are timing out, see if you can get additional CPU time from your ISP, or one of the other suggestions posted here.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: nph-build problem -- abort or looping In reply to
Yes, a few more categories are build, thanks a lot!!
But still about 150 categories are missing. I then tried again the cancelling of the while process with # and edit the HTML_template and the DB_Utils file, as described above. But I still get a "software compilation error" with the nph-build.cgi.
Could somebody print exact the lines I have to edit in the different files?


I edited:

# while (1) {
$categories_r = $CATDB->query ( { ID => '*', mh => $limit, nh => $offset+1, sb => 'Name', so => 'ASC', tb => 0 });

# last unless ($categories_r and @{$categories_r} > 0);

# foreach $category_r (@{$categories_r}) {
$offset++;


in the nph-build.cgi and


@EXPORT = qw/%ok_status %fail_status %all_codes %misc_status
&authenticate &linewrap _attach &load_template &get_template_list &get_totalcats


in the DB_Utils and


sub get_totalcats {
#-----------------------------------------------------
my ($CATDB, $GRAND_TOTAL);
$GRAND_TOTAL = 0;
$CATDB = new Links::DBSQL "$LINKS{admin_root_path}/defs/Category.def";
$GRAND_TOTAL = $CATDB->total();
return $GRAND_TOTAL;
}


also in the DB_Utils and


# You can put variables here that you would like to use in any
# of your templates.

%GLOBALS = (
date => \&Links::DBSQL::get_date,
time => \&Links::DBSQL::get_time,
db_cgi_url => $LINKS{db_cgi_url},
totalcats => &Links::DB_Utils::get_totalcats,
build_root_url => $LINKS{build_root_url},
site_title => $LINKS{build_site_title},
css => $LINKS{build_css_url},
banner => ''
);



in the HTML_Template.
Hope I did it right (no, hope not, so I can change my mistake!)


Thanks to all who helped me so far, really great!! Now I go to bed, the errors with building the site can wait till tomorrow.


Quote Reply
Re: nph-build problem -- abort or looping In reply to
Hi Andreas,

my modification is only to enshure that nph-build does not loop endlessly. It does not decrease the building-time!

To decrease the building-time you have to modify nph-build to accept parameters.

in the beginning change:
use vars qw($USE_HTML $LINKDB $CATDB $EMAIL $HIERARCH $GRAND_TOTAL);

to:
use vars qw($USE_HTML $LINKDB $CATDB $EMAIL $HIERARCH $GRAND_TOTAL $DIRTY);

insert after:
# Determine what type of build we are doing and do it.

insert:
my $in = new CGI;
$DIRTY =$in-> param('dt');
if ($DIRTY eq 'D'){ $DIRTY = 1} else {$DIRTY=0}

now change sub build_all to

sub build_all {
# --------------------------------------------------------
# Rebuilds the entire pages.
#
if ($DIRTY == 0) {
&build_backup();
&build_update_counters();
&build_update_newpop();
&build_detailed_view();
&build_home_page();
&build_static();
&build_new_page();
&build_cool_page();
&build_category_dropdown();
&build_category_pages();
} else {
&build_stats();
}
}

Now you must change the building-links in Admin_HTML.pm
in the sub html_navigation:

<p><$FONT><b>Building</b>
</font>
<$FONT>
<a href="nph-build.cgi?dt=D">Build Stats</a>

<a href="nph-build.cgi">Build All</a>

<a href="nph-index.cgi">Re-Index</a>

<a href="$SCRIPT_URL?db=Links&do=html_edit_template">Edit Templates</a>

<a href="$SCRIPT_URL?db=Search_Log&do=html_keywords&Term=*">Keywords</a>
</font>
</p>

Thats it. Beware to build the stats prior to build the site. If you know a little perl it is easy to modify this workaround to build backups, homepage, detailed pages whats new etc. seprately.

I hope it will help you to get your site running. If you encounter problems, I am on holliday till the 10th of september :)

regards, alexander

Quote Reply
Re: nph-build problem -- abort or looping In reply to
Thanks Alex for your help. If I understand your changes, it will give me the option to build the stats and the rest seperatly. But that I have tried with rem out the building parameters on myself (# out the building in the nph-build.cgi exept for the categories).

But that is not the problem, even with the seperate build of the stats and the rest the building of the categories stops.

I'll try it again: I have installed LinksSQL and it works. I have the unchanged files installed on my server. Everythings works fine exept for the "build all" option, it stops somewhere at category 250 (of 500). I didn't have changed the nph-build.cgi.

Now I am looking for options, how to build the site complete. How is unimportant (just no problems with my ISP, please). Could you please post the lines which I do have to change in the unaltered nph-build.cgi (or other files) that leed to the success, that my suite is build complete. Or any other ways?

The building process may take some time, that does not matter. All I need is a complete built site, the way to the goal is not important. The hints in this post (above) had no effect - sadly -, but thanks for your help (maybe I have done somethin wrong).

Alex, I hope I can reach you with this post before your holiday. But if not, have a nice holiday!! Thanks a lot for your help.
Andreas

Quote Reply
To all who helped me! In reply to
Today I became a hint to build the site via telnet, and really, it worked. I then found this tip in this forum again (and from Alex via Gossamer Threads), on a site some threads away (I have not found these post earlier, sorry). But thanks to all who helped me!!!

> >