Skip to Content
It is currently October 17th, 2019, 5:47 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: July 16th, 2018, 12:35 am 
Offline
Junior User
Junior User

Joined: April 10th, 2010, 2:34 am
Posts: 30
Hi,

My station has been running for many years. It is running now on SAM 2017.5 heavily relied on PAL. I use MySQL 5.6 as the database.

Two days ago SAM started freezing. I managed to pin point the problem, but I have no idea how to fix it.

The freeze occurs in the line "if (AQuery.BOF and AQuery.EOF) then //no request made". You need to have a requests pending in the request queue to reproduce this issue.

Code:

AQuery := Query('SELECT songlist.*, requestlist.*, requestlist.ID as requestID '
+' FROM songlist, requestlist '
+' WHERE (requestlist.ETA<:now) AND (requestlist.status=''new'') AND (songlist.ID=requestlist.songID) '
+ 'ORDER BY requestlist.ETA ASC '
+' LIMIT 1 ',[Now],True);


if (AQuery.BOF and AQuery.EOF) then //no request made
begin

//do some stuff
 
 end;



For now I disabled requests so my station can continue running. I also run a check on the database and everything seem to be OK.


Top
 Profile  
Reply with quote  
PostPosted: July 17th, 2018, 6:05 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7878
Location: Aachen (Germany)
If all you're looking for is whether requests are pending or not and maybe get the topmost pending request, you should probably use the built-in functionality instead of custom SQL queries.

Code:
var nextPendingRequest : TSongInfo;
nextPendingRequest := Req.GetNextRequest;

IF nextPendingRequest = NIL THEN
BEGIN
// No pending requests
END;

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: July 17th, 2018, 10:10 am 
Offline
Junior User
Junior User

Joined: April 10th, 2010, 2:34 am
Posts: 30
Hi,

Thanks for the answer. The reason I use SQL is to get the IP of the requester. Then we say automatically something like: this request comes from....


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group