Commit Graph

117 Commits

Author SHA1 Message Date
Julien Lengrand-Lambert
e2dc517450 Updates flask_app to provide it with generic database url 2013-02-04 14:02:11 +01:00
Julien Lengrand-Lambert
440e938f57 Merges core part with web app part to avoid having multiple dependencies.
Also seems more logical.
2013-02-04 13:52:05 +01:00
Julien Lengrand-Lambert
d3e70ea3a0 Adds connection to database lost error found in PythonAnywhere.
Probably comes from them, but it should not crash everything.
2013-01-31 19:16:03 +01:00
Julien Lengrand-Lambert
f374382032 Adds imit to leader query.
this with addition of an index should dramatically reduce query processing time and increase performance.

Next step is probably to join all queries together and parse in Python afterwards.

TODO:
Start working on rendering again
Try to scale with a hundred hastags.
2013-01-31 16:27:09 +01:00
Julien Lengrand-Lambert
5af74eb10c Adds another index on member table, aiming at hashtags and counts in order to generate the leaderboard faster. 2013-01-31 14:23:47 +01:00
Julien Lengrand-Lambert
b16c64e2c4 Adds file check for ini file.
Now exists gracefully if file is not found.

Avoids ugly errors on first launch when deploying to a new machine
2013-01-31 14:16:30 +01:00
Julien Lengrand-Lambert
b504b2acf4 Reenables tweet logging.
As tweets are now just logged and not crawled any more, insertion time in the database should not be an issue any more.
2013-01-31 14:05:49 +01:00
Julien Lengrand-Lambert
e3f12fb597 Modifies code so that Indexes are really taken into account.
Tested full night without increasing CPU load.
2013-01-30 07:51:16 +01:00
9432d2ca86 Creates indexes to enhance searches in table .
Also activates logging on mysql to look at queries and try to correct if
possible.
2013-01-29 16:52:42 +01:00
Julien Lengrand-Lambert
025c4a7502 Removes small bug finding duplicates where there is none.
Also removes print statement from data.py
2013-01-28 16:45:55 +01:00
Julien Lengrand-Lambert
e27c53db82 Stops logging tweets and directly jumps to hashtags.
Will se later for an efficient way to save tweets too.
Probably a way that doesnt require database.
2013-01-27 18:18:32 +01:00
Julien Lengrand-Lambert
ca833e8616 Stream and StreamSaverListener are also creating rogue connections to the database when adding/removing hashtags.
This had to be taken care of.

Currently is only quick fix, but a better fix should be provided soon.
2013-01-23 21:04:52 +01:00
Julien Lengrand-Lambert
50239be6c6 Uses same trick for leader as for counter.
Reduces the number of simultaneous database connections needed to run the full service.
2013-01-23 20:50:45 +01:00
Julien Lengrand-Lambert
a4749ca591 Attempt to solve max_user_connections issue on mysql in counter
Also attempts to solvedata.oauth being a string instead of a boolean
2013-01-23 16:17:16 +01:00
Julien Lengrand-Lambert
64b7ad819c Adds session.close() that had been forgotten in counter.py
The number of mysql conenctions should decreqse now.

TODO:
Future thoughts to dramatically increase this : Use a database pool.
Threads would simply add new write/commit requests and only one entity actually accesses the database.

This would probably reduce the amount of problems of concurrent connections.
2013-01-23 10:00:19 +01:00
Julien Lengrand-Lambert
176e4b59ab Removes leftover print in data.py 2013-01-23 09:34:11 +01:00
Julien Lengrand-Lambert
04badb7eff Adds log for encoding errors in MySQL.
To be fixed soon
2013-01-23 09:27:12 +01:00
Julien Lengrand-Lambert
7cc5a74ecb Separates encoding scheme for database connexion in ini file. 2013-01-23 09:25:50 +01:00
Julien Lengrand-Lambert
772806d01a Corrects some unicode problems in datamodel
Adds unicode support in mysql database connexion.
Removes all try/catch in commits that were used to avoid SQLite limitations.

FIXME: There is still some problems with special characters handling in MySQL, but it doesnt cause any problem for the leaderboard printing so far.
It has to be fixed though.

TODO:
Add separate encoding parameters in basic.ini
2013-01-23 09:19:40 +01:00
Julien Lengrand-Lambert
86b9c48f79 Adds length to String cloumns in datamodel to fit with SQLite requirements.
A limit of 200 characters has been put for each string.
It should be way more than needed (maximum tweet size is 140 characters)
2013-01-23 08:51:25 +01:00
Julien Lengrand-Lambert
a945b2399c Installs python eff to work with MySQL 2013-01-22 22:53:08 +01:00
julien Lengrand-Lambert
9c119ee1fd Create command_error_3
Another error. 

New, this time !
2013-01-22 06:47:53 -08:00
julien Lengrand-Lambert
a6e8d8301b Create leader_problem_3
Error of database locked again
2013-01-22 05:20:43 -08:00
Julien Lengrand-Lambert
ff05f492bb removes .ini files from repo. Changes leaderboard printing back to html 2013-01-22 11:30:24 +00:00
Julien Lengrand-Lambert
35e2999c18 Implements automatic way to find config file without providing path
Removes database files from repo.
2013-01-22 12:21:47 +01:00
Julien Lengrand-Lambert
ddd9171d0b Now get 420 errors.
INvestigating that.
2013-01-22 11:58:14 +01:00
Julien Lengrand-Lambert
e470ad5617 Finishes converting leader to new config format.
Removes older config format.
Test now before adding commandline argument
2013-01-22 11:36:17 +01:00
Julien Lengrand-Lambert
bb4093be02 converts older use of data in leader to new format.
TODO: Add new variables
2013-01-22 11:29:21 +01:00
Julien Lengrand-Lambert
b2f722dbb6 Counter should be fully converted to new format.
NExt: leader
2013-01-22 11:28:27 +01:00
Julien Lengrand-Lambert
e599f69588 Finishes to convert streamer to new system.
Next to be converted is counter
2013-01-22 11:26:58 +01:00
Julien Lengrand-Lambert
86a06c16f9 Strats creating configuration file handling.
ConfigParser is used and will replace data.py's current system.
Used config file is basic.ini, but might be upgraded later (using command line arguments)

Streamer on it's way to be fully compliant with new system.
2013-01-22 11:23:25 +01:00
Julien Lengrand-Lambert
27f3198d1c Fixes database locked problem in leader.py.
Should be better now, while still far from error proof.
To solve most of the database issues, it might be way simpler to change to another engine.
New problems may arise when clients will start connecting through the web interface.

We'll see.
2013-01-22 10:32:22 +01:00
Julien Lengrand-Lambert
d6b5a23034 Fixes database locked exceptions in counter.
Do same process for leader
2013-01-22 10:28:41 +01:00
Julien Lengrand-Lambert
3a5b25e605 Takes care of database locked exceptions in streamer.
TODO:
    Same process for counter and leader
2013-01-22 10:25:35 +01:00
Julien Lengrand-Lambert
e981d9abb7 Gets back to manual commit process.
Removes autoflushing and autocommiting.
Puts cpt method back in place.

NExt step is to take care of errors/concurrent access more efficiently.
2013-01-22 10:18:02 +01:00
Julien Lengrand-Lambert
c108e0b6ac Corrects small typo 2013-01-22 10:10:34 +01:00
Julien Lengrand-Lambert
ff72fe1aa2 Comments out all commit related code.
Aims at getting compatible with new autoflush/autocommit options for SQLite concurrency.
2013-01-21 22:11:53 +01:00
Julien Lengrand-Lambert
decb96c3a9 Corrects spelling mistake 2013-01-21 22:02:38 +01:00
Julien Lengrand-Lambert
71fae3d90f Merge branch 'master' of https://github.com/jlengrand/twitterboard 2013-01-21 19:12:26 +01:00
Julien Lengrand-Lambert
ca49af09f1 Concurrency changes to database
Activates autocommit and deactivates autoflush to sessions.
This should allow higher concurrency on SQLite.

If things work, I should remove my poor tentative to activate autocommit by myself
2013-01-21 19:08:48 +01:00
Julien Lengrand-Lambert
d8f1949ea7 Cleans sessions in leader.py
Closes all open sessions in leader module.
Adds task to bugs file
2013-01-21 16:43:51 +01:00
jllengrand
d1142fb711 Adds error logs 2013-01-21 07:19:12 +00:00
Julien Lengrand-Lambert
c60a5ee901 Cleans up repo.
Puts all test stuf into tests repo.
Puts all crashes and log into log repo.

I should really start some testing some day :s .
And remove all FIXMEs.

=> This is next step as soon as I got my code running on python anywhere
2013-01-20 21:54:33 +01:00
julien Lengrand-Lambert
7735669b16 Update requirements.txt
Changes requirements to be less constrained. 
Also indicates that SQLAlchemy requirement can be filled by installing Flask.
2013-01-20 21:50:48 +01:00
Julien Lengrand-Lambert
3c2f352688 closes all opened session in streamer.py 2013-01-19 12:33:27 +01:00
Julien Lengrand-Lambert
4aa0270e32 saves error logs to solve session issue 2013-01-18 16:20:08 +01:00
Julien Lengrand-Lambert
b2413100af Update bugs 2013-01-17 13:45:46 +01:00
Julien Lengrand-Lambert
4605f4d1ae Solves bug :
It is possible to create the same hashtag several times in the databse. => Add existence checks

A bug should not be created twice any more in the trendy list.

FIXME:
Fix waas done in the plane with no internet connexion nor ressource.
Code is really bad and not pythonic :s.
Think about doing better.

database has to be cleaned from hashtags to remove duplicates now.
2013-01-16 20:57:43 +01:00
Julien Lengrand-Lambert
24be98f8a8 Should solve bug
Running command.py generates a database problem. Apparently due to passing session/connection between threads.
Sessions have been separated in HashtagLogger to avoid session shaing between threads.

TODO:
Invetigate how many concurrent sessions can be created, and/or how to avoid this problem.
2013-01-16 17:23:51 +01:00
Julien Lengrand-Lambert
abd2137251 Finishes first ugly version of html leaderboard.
The leaderboard is regenerated periodically.

FIXME : Seems to have a problem with threads using command.py. Let s see why
2013-01-15 23:13:11 +01:00