11:16 AM
armalcolite
2016-05-13 13415, 2016
11:19 AM
alastairp
the id is your timestamp, right?
2016-05-13 13439, 2016
11:20 AM
armalcolite
yes
2016-05-13 13451, 2016
11:20 AM
armalcolite
i wanted it to be consistent with cassandra db
2016-05-13 13426, 2016
11:22 AM
Gore
2016-05-13 13428, 2016
11:22 AM
alastairp
right
2016-05-13 13411, 2016
11:23 AM
alastairp
we could combine some of the rows, e.g. the year/month/day should be able to be changed to a Date or DateTime, or even removed
2016-05-13 13417, 2016
11:23 AM
alastairp
this was for our partitioning
2016-05-13 13435, 2016
11:23 AM
alastairp
if we're only storing partial data in postgres it's probably not as important
2016-05-13 13453, 2016
11:23 AM
alastairp
but anyway, the error that you're getting? is that you don't want to be able to add an item twice?
2016-05-13 13441, 2016
11:24 AM
alastairp
so your primary key says "A user can only insert 1 item at a given timestamp"
2016-05-13 13452, 2016
11:24 AM
armalcolite
that is what we want right?
2016-05-13 13426, 2016
11:25 AM
armalcolite
so if someone inserts a listen with same timestamp, we need to save the newer one.
2016-05-13 13440, 2016
11:25 AM
armalcolite
that is what i am struggling to do. :(
2016-05-13 13446, 2016
11:25 AM
alastairp
hmm
2016-05-13 13446, 2016
11:25 AM
armalcolite
in postgresql
2016-05-13 13453, 2016
11:25 AM
alastairp
actually - I'm not sure
2016-05-13 13458, 2016
11:25 AM
alastairp
what if we just ignored it?
2016-05-13 13414, 2016
11:26 AM
armalcolite
currently i am doing the same.
2016-05-13 13427, 2016
11:26 AM
armalcolite
actually the code in that branch is working, if someone want to test
2016-05-13 13433, 2016
11:26 AM
armalcolite
*wants
2016-05-13 13408, 2016
11:27 AM
alastairp
were you trying with INSERT ... ON CONFLICT ... ?
2016-05-13 13429, 2016
11:27 AM
armalcolite
2016-05-13 13448, 2016
11:27 AM
alastairp
Gore: someone will get to you soon. the main server developers are still sleeping
2016-05-13 13400, 2016
11:28 AM
Gore
alastairp thanks :)
2016-05-13 13426, 2016
11:28 AM
alastairp
armalcolite: I think you should have a separate PostgresListenStore and CassandraListenStore
2016-05-13 13443, 2016
11:28 AM
alastairp
so that we can swap them in and out with just 1 line
2016-05-13 13434, 2016
11:29 AM
alastairp
also, the method shouldn't be insert_async_postgres - the async is because of a feature of cassandra. This doesn't exist in postgres so it doesn't make sense to call it that
2016-05-13 13400, 2016
11:30 AM
armalcolite
yeah, a lot of changes have to be done.
2016-05-13 13407, 2016
11:30 AM
armalcolite
this is just the initial commit. :)
2016-05-13 13424, 2016
11:30 AM
alastairp
you should use sqlalchemy to connect to the database. we already have it in some places in LB for the user accounts
2016-05-13 13424, 2016
11:30 AM
kanha has quit
2016-05-13 13437, 2016
11:30 AM
alastairp
it gives us much easier transaction control than just having psycopg2
2016-05-13 13401, 2016
11:31 AM
alastairp
but that looks good
2016-05-13 13406, 2016
11:31 AM
armalcolite
regarding separate ListenStore, there are a lot of common functions. Then, should i remove them from class?
2016-05-13 13419, 2016
11:31 AM
alastairp
you can have a parent class ListenStore
2016-05-13 13423, 2016
11:31 AM
alastairp
for the common functions
2016-05-13 13429, 2016
11:31 AM
armalcolite
sure. :)
2016-05-13 13432, 2016
11:31 AM
alastairp
and subclasses for the backend-specific code
2016-05-13 13433, 2016
11:31 AM
kanha joined the channel
2016-05-13 13401, 2016
11:32 AM
alastairp
I'm going to lunch
2016-05-13 13451, 2016
11:32 AM
armalcolite
alastairp: please review the existing PR's whenever u get time.
2016-05-13 13453, 2016
11:44 AM
ruaok
yah, I need food too. Are you going to be around in 2 hours armalcolite ?
2016-05-13 13410, 2016
11:45 AM
armalcolite
ruaok: sure. :)
2016-05-13 13415, 2016
11:45 AM
ruaok
ok, cool.
2016-05-13 13432, 2016
11:45 AM
ruaok
zas and I are done with the most important work of the day, so I can focus on some LB stuff this afternoon.
2016-05-13 13448, 2016
12:01 PM
MajorLurker has quit
2016-05-13 13444, 2016
12:12 PM
Freso
2016-05-13 13415, 2016
12:16 PM
armalcolite
Freso: oh. sure.
2016-05-13 13407, 2016
12:17 PM
armalcolite
2016-05-13 13421, 2016
12:17 PM
Freso
I use ptpb.pw most of the time. :)
2016-05-13 13428, 2016
12:17 PM
armalcolite
Freso: have been looking for something like that since a long time. (was planning to make one)
2016-05-13 13438, 2016
12:17 PM
Freso
Well, that and gist.
2016-05-13 13411, 2016
12:18 PM
Freso
ptpb.pw when I just want to toss things out there, and Gist when I want to have a bit more control.
2016-05-13 13443, 2016
12:18 PM
armalcolite
some provide API access, so i was planning to make one. You saved my time. :)
2016-05-13 13443, 2016
12:18 PM
UmkaDK_ joined the channel
2016-05-13 13448, 2016
12:18 PM
Freso
(Gists are Git version controlled, so I can clone a gist locally and work on it, and since (non-anonymous) gists are tied to my GitHub account, I can also delete them later.)
2016-05-13 13404, 2016
12:19 PM
Freso
armalcolite: That's what FOSS is all about, no? :p
2016-05-13 13420, 2016
12:19 PM
armalcolite
Freso: yeah, i spent a lot of time in making one for imgur. :P
2016-05-13 13441, 2016
12:19 PM
armalcolite
Freso: sometimes you can't help when ideas overload your mind.
2016-05-13 13445, 2016
12:19 PM
armalcolite
:P
2016-05-13 13445, 2016
12:19 PM
Freso
Mhm.
2016-05-13 13402, 2016
12:20 PM
armalcolite
2016-05-13 13456, 2016
12:20 PM
UmkaDK has quit
2016-05-13 13452, 2016
12:29 PM
chrisskye
Freso: yes. videolan is in the system
2016-05-13 13419, 2016
12:31 PM
chrisskye
logo should be put up on the page...
2016-05-13 13441, 2016
12:36 PM
chrisskye
Gentlecat: can you post the Videolan logo...it is there in there registration account
2016-05-13 13410, 2016
12:37 PM
chrisskye
fre
2016-05-13 13440, 2016
12:37 PM
chrisskye
Freso: we just need a one line description to post below the logo, describing how they use MB
2016-05-13 13459, 2016
12:45 PM
Freso
chrisskye: "thresh | Freso, VLC uses Musicbrainz data to lookup releases to find corresponding album art"
2016-05-13 13431, 2016
12:51 PM
Freso
Actually, hold that.
2016-05-13 13413, 2016
12:53 PM
Freso
chrisskye: "thresh | "VLC uses MusicBrainz for looking up CD data as well as finding cover art for releases.""
2016-05-13 13426, 2016
12:53 PM
Freso
Possibly "to look up CD data".
2016-05-13 13442, 2016
12:53 PM
Freso
And "VLC media player".
2016-05-13 13447, 2016
12:53 PM
Freso
So.
2016-05-13 13420, 2016
12:54 PM
Freso
"VLC media player uses MusicBrainz (for looking/to look) up CD data as well as finding cover art for releases."
2016-05-13 13434, 2016
12:54 PM
Freso
chrisskye: ^ does that work?
2016-05-13 13447, 2016
12:54 PM
Freso relaying conversation between two IRC channels :p
2016-05-13 13418, 2016
12:55 PM
chrisskye
hahahah Pick one, and then we have to kindly ask Gentlcat or ruaok to post it.
2016-05-13 13422, 2016
12:55 PM
chrisskye
last version then?
2016-05-13 13426, 2016
12:55 PM
Freso
chrisskye: The last one.
2016-05-13 13428, 2016
12:55 PM
Freso
Yeah.
2016-05-13 13403, 2016
12:56 PM
Freso
chrisskye: None of the involved parties, except for you, seem to be native English speakers. So you get to pick between "for looking" and "to look" :)
2016-05-13 13424, 2016
12:57 PM
chrisskye
done. :)
2016-05-13 13433, 2016
12:58 PM
chrisskye
spent all morning and part of yesterday afternoon doing Spanish bureaucracy...and in the interim we had 5 new sign-ups!
2016-05-13 13446, 2016
12:58 PM
Freso
Wow. Nice. :)
2016-05-13 13451, 2016
12:58 PM
chrisskye
And, at least half are offering money.
2016-05-13 13408, 2016
12:59 PM
Freso
At least half... of 5. :p
2016-05-13 13420, 2016
12:59 PM
chrisskye
...writing back, means, writing back and forth... So...like all things in this country...I’m behind on my work!!!
2016-05-13 13453, 2016
12:59 PM
Freso
"When in Rome, do as the Romans", sí?
2016-05-13 13454, 2016
12:59 PM
chrisskye
hehehe...I counted the mobile level ($10) and a semi
2016-05-13 13422, 2016
13:00 PM
chrisskye
as
2016-05-13 13444, 2016
13:00 PM
chrisskye
...but glancing at the one, I think they should pay more...which means a long letter
2016-05-13 13450, 2016
13:00 PM
chrisskye
so it goes
2016-05-13 13434, 2016
13:14 PM
D4RK-PH0ENiX has quit
2016-05-13 13426, 2016
13:15 PM
ruaok wonders how he missed thresh signing up
2016-05-13 13434, 2016
13:15 PM
ruaok
clearly I approved it.
2016-05-13 13418, 2016
13:19 PM
ruaok
alastairp, armalcolite: I'm thinking about the replacement semantics for the UPSERT.
2016-05-13 13437, 2016
13:19 PM
ruaok
ignore seems like a valid mode -- first write will stay.
2016-05-13 13450, 2016
13:19 PM
ruaok
if that seems like something that needs changing, we can change it later with no real impact on the database.
2016-05-13 13409, 2016
13:20 PM
ruaok
armalcolite: you code works with ignore right now, right? if so, then we're good to go with that.
2016-05-13 13420, 2016
13:20 PM
armalcolite
ruaok: yeah. it works fine
2016-05-13 13429, 2016
13:20 PM
ruaok
ok, then leave it be for now.
2016-05-13 13451, 2016
13:20 PM
ruaok
regarding the "id" column naming.
2016-05-13 13415, 2016
13:21 PM
ruaok
while I appreciate you wanting to keep things in sync with the cassandra bit, it conflicts with our existing conventions used in postgres.
2016-05-13 13408, 2016
13:22 PM
alastairp
ruaok: right, I think we should think about this is a day-to-day system
2016-05-13 13419, 2016
13:22 PM
alastairp
if an app submits twice, it's an error
2016-05-13 13427, 2016
13:22 PM
alastairp
if the app made an error submitting, we should delete it
2016-05-13 13448, 2016
13:22 PM
ruaok
I think we should change the id field to be "ts TIMESTAMP WITH TIMEZONE"
2016-05-13 13450, 2016
13:22 PM
Freso
ruaok: :)
2016-05-13 13459, 2016
13:22 PM
ruaok
and remove the day, month, year columns. they are not needed.
2016-05-13 13416, 2016
13:23 PM
alastairp
sounds good to me
2016-05-13 13419, 2016
13:23 PM
armalcolite
ruaok: ok.
2016-05-13 13434, 2016
13:23 PM
armalcolite
alastairp: i also separated the classes. have a look.
2016-05-13 13443, 2016
13:23 PM
alastairp
perhaps we should do our standard AB table split here too
2016-05-13 13448, 2016
13:23 PM
ruaok
alastairp: the problem with throwing an error that it is hard to give a meaningful error message.
2016-05-13 13452, 2016
13:23 PM
alastairp
put the json in a different table
2016-05-13 13403, 2016
13:24 PM
ruaok
if you have 1000 listens to submit you have no idea which row was the offending one.
2016-05-13 13403, 2016
13:24 PM
alastairp
ruaok: oh, I didn't mean report the error
2016-05-13 13411, 2016
13:24 PM
armalcolite
2016-05-13 13412, 2016
13:24 PM
alastairp
I meant to say "the app made an error and we should ignore it"
2016-05-13 13424, 2016
13:24 PM
alastairp
armalcolite: you should open this as a pull request
2016-05-13 13429, 2016
13:24 PM
alastairp
don't worry if it's not finished
2016-05-13 13429, 2016
13:24 PM
ruaok
ah. which then is an argument for "the current setup is fine", yes?
2016-05-13 13439, 2016
13:24 PM
alastairp
it just makes it easier for us to comment on it
2016-05-13 13441, 2016
13:24 PM
armalcolite
alastairp: ok. will do.
2016-05-13 13444, 2016
13:24 PM
alastairp
ruaok: yes, that's what I wanted to say
2016-05-13 13449, 2016
13:24 PM
ruaok
current setup being UPSET with ignore.
2016-05-13 13451, 2016
13:24 PM
ruaok
fabu.
2016-05-13 13401, 2016
13:25 PM
ruaok
UPSET. :)
2016-05-13 13402, 2016
13:25 PM
alastairp
i'm so UPSET
2016-05-13 13411, 2016
13:25 PM
alastairp
sounds like MeB
2016-05-13 13419, 2016
13:26 PM
github joined the channel
2016-05-13 13420, 2016
13:26 PM
github
2016-05-13 13420, 2016
13:26 PM
github has left the channel
2016-05-13 13456, 2016
13:26 PM
armalcolite
2016-05-13 13439, 2016
13:29 PM
alastairp
I'll need to look at it in more detail
2016-05-13 13452, 2016
13:29 PM
armalcolite
alastairp: sure.
2016-05-13 13423, 2016
13:30 PM
armalcolite
alastairp: and please skip 'print' comments, i will remove them by tomorrow. :)
2016-05-13 13451, 2016
13:30 PM
armalcolite
alastairp: i left a lot of 'print's to test stuff. that is the reason i did not put up a PR.
2016-05-13 13424, 2016
13:33 PM
armalcolite
also, i am not sure if this was intended, but the table name in postgres is '"user"' not 'user'
2016-05-13 13444, 2016
13:33 PM
alastairp
right - but if you make a commit then you still need to remove it in another commit
2016-05-13 13458, 2016
13:33 PM
alastairp
it would be better to not commit it in the first place
2016-05-13 13404, 2016
13:34 PM
alastairp
git add -p is useful here
2016-05-13 13421, 2016
13:34 PM
alastairp
right. user is a reserved word in postgres, so you need to surround it in "" quotes
2016-05-13 13422, 2016
13:34 PM
diana_olhovyk_ has quit
2016-05-13 13440, 2016
13:34 PM
alastairp
I'm not super happy with the choice, because it adds complexity
2016-05-13 13414, 2016
13:35 PM
armalcolite
oh, i was not aware of that. :)
2016-05-13 13427, 2016
13:36 PM
Freso
git add/commit -p is ❤️
2016-05-13 13446, 2016
13:37 PM
alastairp
you can make a table called `select` if you want