Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run payday #4 #19

Closed
Changaco opened this issue Mar 2, 2016 · 7 comments
Closed

Run payday #4 #19

Changaco opened this issue Mar 2, 2016 · 7 comments
Assignees
Labels

Comments

@Changaco
Copy link
Member

Changaco commented Mar 2, 2016

Previous: #16.

@Changaco Changaco added the Payday label Mar 2, 2016
@Changaco Changaco self-assigned this Mar 2, 2016
@Changaco
Copy link
Member Author

Changaco commented Mar 2, 2016

DB backup taken.

@Changaco
Copy link
Member Author

Changaco commented Mar 2, 2016

/o\

% python liberapay/billing/payday.py 
pid-127417 thread-139712675387136 (MainThread) 200 OK                               /assets/base.css         ./assets/base.css.spt
pid-127417 thread-139712675387136 (MainThread) 200 OK                               /assets/base.js          ./assets/base.js.spt
pid-127417 thread-139712675387136 (MainThread) 200 OK                               /assets/widgets/donate.svg ./assets/widgets/donate.svg.spt
Traceback (most recent call last):
  File "liberapay/billing/payday.py", line 585, in main
    Payday.start().run(log_dir, keep_log)
  File "liberapay/billing/payday.py", line 40, in start
    d = cls.db.one("""
AttributeError: type object 'Payday' has no attribute 'db'

Changaco added a commit to liberapay/liberapay.com that referenced this issue Mar 2, 2016
@Changaco
Copy link
Member Author

Changaco commented Mar 2, 2016

Fixed in liberapay/liberapay.com@d1c6342. Now:

pid-209171 thread-140413925730048 (MainThread) Starting payday #4.
pid-209171 thread-140413925730048 (MainThread) Payday started at 2016-03-02 13:22:54.690032+00:00.
pid-209171 thread-140413925730048 (MainThread) Greetings, program! It's PAYDAY!!!!
pid-209171 thread-140413925730048 (MainThread) Prepared the DB.
Traceback (most recent call last):
  File "liberapay/billing/payday.py", line 587, in main
    Payday.start().run(log_dir, keep_log)
  File "liberapay/billing/payday.py", line 78, in run
    self.shuffle(log_dir)
  File "liberapay/billing/payday.py", line 109, in shuffle
    self.transfer_virtually(cursor)
  File "liberapay/billing/payday.py", line 374, in transfer_virtually
    """)
  File "lib/python2.7/site-packages/postgres/cursors.py", line 92, in run
    self.execute(sql, parameters)
  File "lib/python2.7/site-packages/psycopg2/extras.py", line 288, in execute
    return super(NamedTupleCursor, self).execute(query, vars)
ProgrammingError: relation "our_takes" already exists
CONTEXT:  SQL statement "CREATE TEMPORARY TABLE our_takes ON COMMIT DROP AS
                    SELECT t.member, (round_up(t.amount * takes_ratio, 2)) AS amount
                      FROM payday_takes t
                     WHERE t.team = team_id"
PL/pgSQL function resolve_takes(bigint) line 32 at SQL statement

Changaco added a commit to liberapay/liberapay.com that referenced this issue Mar 2, 2016
@Changaco
Copy link
Member Author

Changaco commented Mar 2, 2016

Fixed in liberapay/liberapay.com@7821159.

@Changaco
Copy link
Member Author

Changaco commented Mar 2, 2016

Script ran for 15 seconds (0:00:15.222216).

@Changaco
Copy link
Member Author

Changaco commented Mar 2, 2016

# select * from paydays;
 id |           ts_start            |            ts_end             | nparticipants | ntippers | ntippees | ntips | ntransfers | transfer_volume | ntakes | take_volume | nactive | nusers | week_deposits | week_withdrawals 
----+-------------------------------+-------------------------------+---------------+----------+----------+-------+------------+-----------------+--------+-------------+---------+--------+---------------+------------------
  1 | 2016-02-10 14:15:12.857116+00 | 2016-02-10 14:16:20.367284+00 |            20 |        7 |        6 |     5 |         11 |            5.16 |      6 |        2.01 |       9 |     30 |        102.00 |             0.00
  2 | 2016-02-17 09:34:56.46043+00  | 2016-02-17 09:42:30.279562+00 |            24 |        8 |        6 |     5 |         13 |            5.91 |      8 |        3.01 |      10 |     39 |         10.00 |             0.00
  3 | 2016-02-24 12:10:24.637909+00 | 2016-02-24 12:13:54.69294+00  |            31 |        9 |        6 |     5 |         15 |            7.48 |     10 |        4.58 |      11 |     46 |          0.00 |             0.00
  4 | 2016-03-02 13:22:54.690032+00 | 2016-03-02 13:28:28.41217+00  |            42 |       11 |        6 |     5 |         18 |            8.09 |     13 |        5.19 |      12 |     63 |         30.00 |             0.00
(4 rows)

@Changaco
Copy link
Member Author

Changaco commented Mar 2, 2016

@Changaco Changaco closed this as completed Mar 2, 2016
@Changaco Changaco mentioned this issue Mar 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant