Time |
Nick |
Message |
04:27 |
|
gsams joined #evergreen |
06:01 |
pinesol |
News from qatests: Failed Running perl live tests <http://testing.evergreen-ils.org/~live//archive/2021-09/2021-09-16_04:00:02/test.49.html> |
07:11 |
|
rjackson_isl_hom joined #evergreen |
07:40 |
|
mantis joined #evergreen |
07:42 |
|
collum joined #evergreen |
08:32 |
|
mmorgan joined #evergreen |
08:33 |
|
tlittle joined #evergreen |
08:42 |
|
rfrasur joined #evergreen |
08:46 |
|
Dyrcona joined #evergreen |
09:24 |
|
jvwoolf joined #evergreen |
09:35 |
mmorgan |
Is there a process that runs regularly to update patron penalties? Does the fine generator do it? |
09:36 |
mmorgan |
IOW, if I make a change to the group penalty thresholds, how does that apply to all patrons? |
09:38 |
Dyrcona |
The fine generator does it, IIRC. |
09:43 |
Dyrcona |
There's also a database function that you could run manually if you're really anxious to update patrons: CREATE OR REPLACE FUNCTION actor.calculate_system_penalties( match_user INT, context_org INT ) RETURNS SETOF actor.usr_standing_penalty |
09:43 |
Dyrcona |
Or, you could use that to see if the penalties will actually apply to the patrons that you think they should. |
09:45 |
mmorgan |
Dyrcona: Ok, thanks. I can see that my test patron got the penalty at 12:30am, and that's when the fine generator runs, so that works for me! |
09:47 |
Dyrcona |
Glad to hear it worked. |
09:47 |
mmorgan |
Good to know about the function, though. So that returns the set of penalties and you'd need to INSERT into actor.usr_standing_penalty? Or does that do the INSERT? |
09:47 |
mmorgan |
Or the delete in some cases? |
09:49 |
berick |
the db func does not apply changes, it just calculates the needed changes |
09:49 |
berick |
API open-ils.actor.user.penalties.update would do it, though |
09:50 |
Dyrcona |
It doesn't insert nor delete. It ... |
09:50 |
Dyrcona |
What berick said. :) |
09:50 |
berick |
a bulk penalty updater function would be super handy though |
09:50 |
mmorgan |
Indeed! |
09:52 |
mmorgan |
The fine generator will work for my purposes, but I can see where an updater function would be handy. In this case we're adding a penalty, but when removing a penalty, or lowering a threshold, it would be good to be able to do that without needing to wait for the fine generator. |
09:52 |
mmorgan |
Dyrcona++ |
09:52 |
mmorgan |
berick++ |
09:55 |
Dyrcona |
A backend call to update penalties for patrons in a batch would also be useful. |
09:55 |
berick |
to be clear the fine generator only updates penalties for patrons it processes, i.e. patrons that acquire new fines during the fine generator run |
09:57 |
mmorgan |
Oh. That's good to know. Might not work for my purposes, then :-( |
10:05 |
Dyrcona |
You could write some moderately complicated SQL code to do what you want. I'd probably use a DO block with a FOR loop over a SELECT that finds the patrons that need the updated penalties. |
10:34 |
|
Stompro joined #evergreen |
11:18 |
|
mantis joined #evergreen |
12:08 |
|
jihpringle joined #evergreen |
12:37 |
|
jihpringle joined #evergreen |
13:58 |
|
nfBurton joined #evergreen |
14:50 |
|
JonHGeorg joined #evergreen |
14:59 |
JonHGeorg |
@mmorgan Not sure if you saw this. I have a couple of questions about the SQL you posted. What is the 351 at the end of line 3? I'm assuming I use "bill.billing_ts >= '2021-08-19' and bill.billing_ts <= '2021-09-13'" to specify the exact date range. How would you recommend I break that into batches? Anything else I'm missing? |
14:59 |
pinesol |
JonHGeorg: What do you mean? An African or European swallow? |
15:00 |
JonHGeorg |
I love a monty python quote as much as anyone else but don't know the context. |
15:02 |
Dyrcona |
JonHGeorg: When you type @ in front of a word, our bot assumes it is a command. If it sees a command that it doesn't understand, it run the dunno command which picks a random entry from its response database. |
15:02 |
Dyrcona |
@dunno |
15:02 |
pinesol |
Dyrcona: you have exposed a flaw in the Internet and will be reported |
15:02 |
JonHGeorg |
Ah. Okay, I thought it was directing my comment to a specific person in this case mmorgan who posted the SQL I asked about. Sorry. |
15:02 |
Dyrcona |
@quote get 111 |
15:02 |
pinesol |
Dyrcona: Quote #111: "< RoganH> Obviously they weren't from the south or they would have tried deep frying it." (added by csharp at 12:22 PM, April 15, 2015) |
15:11 |
Dyrcona |
JonHGeorg: No problem. IRC is weird. Usually, you just type the name of the person and their client will see it an notify them. |
15:13 |
Dyrcona |
As for batching, I usual write a separate SQL script and run them separately, or I use Perl or Python to manage parallel batches. JDBC for Java has a wonder BatchStatement object that when combined with threads can give really good results. |
16:00 |
|
jihpringle joined #evergreen |
16:17 |
|
jvwoolf left #evergreen |
17:01 |
|
mmorgan left #evergreen |
18:01 |
pinesol |
News from qatests: Failed Running perl live tests <http://testing.evergreen-ils.org/~live//archive/2021-09/2021-09-16_16:00:03/test.49.html> |
18:07 |
|
Stompro joined #evergreen |
18:49 |
|
alynn26 joined #evergreen |
19:10 |
|
Stompro joined #evergreen |
21:15 |
|
Stompro joined #evergreen |