jmh9072 / ustalk

Automatically exported from code.google.com/p/ustalk
0 stars 0 forks source link

Fix frequently occuring error message from logs #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
[error] PHP Warning:  Cannot modify header information - headers already sent 
by (output started at ustalk/stalk.php:30) in ustalk/template/xml.php on line 2

What steps will reproduce the problem?
1. Run the current SVN head code on a server

I suspect this is an issue in calling update.php from stalk.php (stalk flushes 
it's output to the client, then calls update.php on each user).

Original issue reported on code.google.com by Firebird347 on 12 Dec 2010 at 11:07

GoogleCodeExporter commented 9 years ago

Original comment by Firebird347 on 12 Dec 2010 at 11:13

GoogleCodeExporter commented 9 years ago
In the last apache error_log there were 846,759 of these!

Original comment by Firebird347 on 12 Dec 2010 at 11:30

GoogleCodeExporter commented 9 years ago
I think the proper fix to this is to move the logic code in page/update.php to 
lib/bungie.php. It would split into two functoins, updateUsers(array of bid) 
returns array of users, updateUser(bid), returns array representing user. From 
the stalk page we will then call this function directly, which eliminates the 
output generation of the page, and from page/update.php we will call the 
function then call template('userXML', $user) for each returned user.

Ideally this would probably switch to a backend queuing system such as 
beanstalkd which would allow us to give an absolute rate limit to requests to 
b.net, but until then, this should silence the warnings, and make it easier to 
implement a beanstalk backend later (just add job to queue, then queue pulls 
them off and processes them). API remains unchanged.

Original comment by Firebird347 on 22 Dec 2010 at 6:57

GoogleCodeExporter commented 9 years ago

Original comment by Firebird347 on 22 Dec 2010 at 6:57

GoogleCodeExporter commented 9 years ago
Should be fixed in r36.

Original comment by Firebird347 on 22 Dec 2010 at 10:17