Welcome to Geeklog, Anonymous Monday, July 04 2022 @ 06:06 pm EDT

Geeklog Forums

Autoarchive issues


Status: offline

scubasteve

Forum User
Junior
Registered: 11/19/04
Posts: 24
Since enabling the autoarchive feature I have been seeing massive entries in error.log. Here is small chunk of what I have been seeing. It appears that it is repeatidly going through EVERY archived message and, well, I don't know exactly what it is doing. When I originally enabled the archive feature by creating a archive topic, I went into the mysql database and basically changed the field that tells geeklog what topic each story belongs to. In all, I moved about 100 stories from one topic to another.

Here is the log. This goes on and on repeating the story IDs over and over. Error.log is already up to 2mb.

Help!


Tue Feb 1 16:32:29 2005 - Archive Story: 20050119192227792, Topic:archive, Title: "story title" Expired :2005-01-19 19:29:27
Tue Feb 1 16:32:29 2005 - Archive Story: 20050119193145610, Topic:archive, Title: "story title" Expired :2005-01-19 19:35:18
Tue Feb 1 16:32:29 2005 - Archive Story: 20050124082640593, Topic:archive, Title: "story title" Expired :2005-01-24 11:21:05
Tue Feb 1 16:32:29 2005 - Archive Story: 20050124095450162, Topic:archive, Title: "story title". Expired :2005-01-28 09:54:50
Tue Feb 1 16:32:29 2005 - Archive Story: 2005012513155975, Topic:archive, Title: "story title" Expired :2005-01-27 17:00:59
Tue Feb 1 16:32:29 2005 - Archive Story: 20050128110617837, Topic:archive, Title: "story title" Expired :2005-01-28 11:46:17
Tue Feb 1 16:32:29 2005 - Archive Story: 20050128190443468, Topic:archive, Title: "story title" Expired :2005-01-30 19:20:40
Tue Feb 1 16:33:03 2005 - Archive Story: 20040819080447925, Topic:archive, Title: "story title" Expired :2005-01-29 18:22:07
Tue Feb 1 16:33:03 2005 - Archive Story: 20040923111307421, Topic:archive, Title: "story title" Expired :2005-01-19 17:46:11
Tue Feb 1 16:33:03 2005 - Archive Story: 20041208170647888, Topic:archive, Title: "story title" Expired :2004-12-22 13:40:35
Tue Feb 1 16:33:03 2005 - Archive Story: 20041213135719147, Topic:archive, Title: "story title" Expired :2004-12-17 21:34:26
Tue Feb 1 16:33:03 2005 - Archive Story: 20041215131849491, Topic:archive, Title: "story title" Expired :2004-12-25 12:00:47
Tue Feb 1 16:33:03 2005 - Archive Story: 20041220142428384, Topic:archive, Title: "story title" Expired :2004-12-22 11:35:58
Tue Feb 1 16:33:03 2005 - Archive Story: 20041228104626551, Topic:archive, Title: "story title" Expired :2005-01-29 18:24:19
Tue Feb 1 16:33:03 2005 - Archive Story: 2004123009202753, Topic:archive, Title: "story title" Expired :2005-01-07 11:58:11
Tue Feb 1 16:33:03 2005 - Archive Story: 20050103142804863, Topic:archive, Title: "story title" Expired :2005-01-03 14:36:35
Tue Feb 1 16:33:03 2005 - Archive Story: 20050110124521653, Topic:archive, Title: "story title" Expired :2005-01-25 18:21:24
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Are error log entries still be recorded once the stories have been archvived ?

Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

scubasteve

Forum User
Junior
Registered: 11/19/04
Posts: 24
Yes. It has multiple entries for EVERY archived story several times each day.
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Are you comfortable with making a change to the code?

I think I see the issue and wanted you to test it.
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

scubasteve

Forum User
Junior
Registered: 11/19/04
Posts: 24
Actually, it has a log entry for every archived story about about 4 times an hour. Can someone help me
 Quote

Status: offline

scubasteve

Forum User
Junior
Registered: 11/19/04
Posts: 24
I think I see the issue and wanted you to test it.

Why the hell not. Big Celebration Shocked
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Ok ..

In the main site index.php, find this block of code at approx line 128
Text Formatted Code

// Scan for any stories that have expired and should be archived or deleted
$expiresql = DB_query ("SELECT sid,tid,title,expire,statuscode FROM {$_TABLES['stories']} WHERE (expire <= NOW()) AND (statuscode = " . STORY_ARCHIVE_ON_EXPIRE . " OR statuscode = " . STORY_DELETE_ON_EXPIRE . ")");
while (list ($sid, $expiretopic, $title, $expire, $statuscode) = DB_fetchArray ($expiresql)) {
    if ($statuscode == STORY_ARCHIVE_ON_EXPIRE) {
        if ($archivetid == ' ') {
            // Retrieve the archive topic - currently only one supported
            $archivetid = DB_getItem ($_TABLES['topics'], 'tid',
                                      "archive_flag='1'");
        }
        if (!empty ($archivetid)) {
            COM_errorLOG("Archive Story: $sid, Topic:$archivetid, Title: $title. Expired :$expire");
            DB_query ("UPDATE {$_TABLES['stories']} SET tid = '$archivetid', frontpage = '0', featured = '0' WHERE sid='{$sid}'");
        }

 


You can see the COM_errorLOG stmt at approx line 140 if it finds you have defined an archive topic id.

When I added this code, I forgot to also add the condition that once it actually archives the topic (moves it) which the code inside this IF block does - then skip this once it's moved.

So we need to add the additional test to see if the topic I am checking is now already archived. The only change in the code below should be to line 137 where the IF condition test now has the addition check.

Text Formatted Code

// Scan for any stories that have expired and should be archived or deleted
$expiresql = DB_query ("SELECT sid,tid,title,expire,statuscode FROM {$_TABLES['stories']} WHERE (expire <= NOW()) AND (statuscode = " . STORY_ARCHIVE_ON_EXPIRE . " OR statuscode = " . STORY_DELETE_ON_EXPIRE . ")");
while (list ($sid, $expiretopic, $title, $expire, $statuscode) = DB_fetchArray ($expiresql)) {
    if ($statuscode == STORY_ARCHIVE_ON_EXPIRE) {
        if ($archivetid == ' ') {
            // Retrieve the archive topic - currently only one supported
            $archivetid = DB_getItem ($_TABLES['topics'], 'tid',
                                      "archive_flag='1'");
        }
        if (!empty ($archivetid) AND $expiretopic != $archivetid) {
            COM_errorLOG("Archive Story: $sid, Topic:$archivetid, Title: $title. Expired :$expire");
            DB_query ("UPDATE {$_TABLES['stories']} SET tid = '$archivetid', frontpage = '0', featured = '0' WHERE sid='{$sid}'");
        }

 


Let me know if that works.
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

scubasteve

Forum User
Junior
Registered: 11/19/04
Posts: 24
"AND $expiretopic != $archivetid)"

I added the above code. I will give you an update in an hour or so. Its a deal - shaking hands
 Quote

Status: offline

scubasteve

Forum User
Junior
Registered: 11/19/04
Posts: 24
Well, so far so good. No additional entries in error.log. I will update again later.

Thanks for the quick help! Cool
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Blaine: So we need to add the additional test to see if the topic I am checking is now already archived. The only change in the code below should be to line 137 where the IF condition test now has the addition check.

Another option would be to set the status back to 0 in that UPDATE request ...

bye, Dirk
 Quote

Status: offline

scubasteve

Forum User
Junior
Registered: 11/19/04
Posts: 24
Still no entries in error.log. Looks like everything is fixed. I will update this thread again if it re-appears but I doubt it will. Once again, thanks for the help.
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Quote by Dirk: Another option would be to set the status back to 0 in that UPDATE request ...

Could you please elaborate a little bit on this one. I'm having a similar problem now. It's amazing how big the error.log can get Shocked
Geeklog Polish Support Team
 Quote

All times are EDT. The time is now 06:06 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content