- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
// can only do five hundred at a time. can't find documentation
// for this number, but if I do more than that I get an error
// message
for (five_hundred <- pageranks.grouped(500))
{
try
{
upload(five_hundred)
}
catch
{
// the datastore is not entirely reliable. for less than 1% of the
// calls it seems to fail randomly. which is a bit annoying if
// you're uploading a lot of data and don't want to stop when half of
// it is already stored
case ex : Throwable =>
{
try
{
ex.printStackTrace()
// try a second time
upload(five_hundred)
}
catch
{
// don't try a third time. just continue
case ex : Throwable => ex.printStackTrace()
}
}
}
}
Наткнулся на пост, в котором некий Ph. D рекламировал scala в качестве замены питону
kurwa 09.06.2016 09:56 # 0
Fike 09.06.2016 11:31 # 0
3.14159265 09.06.2016 13:38 # 0
Интересно, а если заказчик datastore станет требовать 5 попыток?
roman-kashitsyn 09.06.2016 14:20 # 0
guest 11.06.2016 00:10 # +1