Git Product home page Git Product logo

isucon8-final's People

Contributors

dependabot[bot] avatar yang-33 avatar

Watchers

 avatar  avatar

isucon8-final's Issues

403を追加する

問題文のsignup, signinの5回リクエストしてもだめなときの対応が無いので書く

[DB TABLE ALL]

ORDER
+--------+------+---------+--------+-------+----------------------------+----------+----------------------------+
| id | type | user_id | amount | price | closed_at | trade_id | created_at |
+--------+------+---------+--------+-------+----------------------------+----------+----------------------------+
| 123436 | sell | 1235 | 1 | 5000 | 2018-10-11 10:00:00.682000 | 34124 | 2018-10-11 10:00:00.559000 |
| 123437 | buy | 1236 | 1 | 5000 | 2018-10-11 10:00:00.682000 | 34124 | 2018-10-11 10:00:00.626000 |
| 123438 | sell | 1237 | 1 | 4999 | 2018-10-11 10:00:01.758000 | 34125 | 2018-10-11 10:00:01.635000 |
| 123439 | buy | 1238 | 1 | 4999 | 2018-10-11 10:00:01.758000 | 34125 | 2018-10-11 10:00:01.702000 |
| 123440 | sell | 1239 | 1 | 4999 | 2018-10-11 10:00:03.520000 | 34126 | 2018-10-11 10:00:03.397000 |
| 123441 | buy | 1240 | 1 | 4999 | 2018-10-11 10:00:03.520000 | 34126 | 2018-10-11 10:00:03.464000 |
| 123442 | sell | 1241 | 1 | 4998 | 2018-10-11 10:00:05.042000 | 34127 | 2018-10-11 10:00:04.919000 |
| 123443 | buy | 1242 | 1 | 4998 | 2018-10-11 10:00:05.042000 | 34127 | 2018-10-11 10:00:04.986000 |
| 123444 | sell | 1243 | 1 | 4999 | 2018-10-11 10:00:08.667000 | 34128 | 2018-10-11 10:00:08.544000 |
| 123445 | buy | 1244 | 1 | 4999 | 2018-10-11 10:00:08.667000 | 34128 | 2018-10-11 10:00:08.611000 |
+--------+------+---------+--------+-------+----------------------------+----------+----------------------------+

SETTING
+---------------+-----------------------------------------------+
| name | val |
+---------------+-----------------------------------------------+
| bank_appid | jtd5227vjp |
| bank_endpoint | https://compose.isucon8.flying-chair.net:5515 |
| log_appid | gpw9nb8wxkxv |
| log_endpoint | https://compose.isucon8.flying-chair.net:5516 |
+---------------+-----------------------------------------------+

TRADE
+-------+--------+-------+----------------------------+
| id | amount | price | created_at |
+-------+--------+-------+----------------------------+
| 34124 | 1 | 5000 | 2018-10-11 10:00:00.682000 |
| 34125 | 1 | 4999 | 2018-10-11 10:00:01.758000 |
| 34126 | 1 | 4999 | 2018-10-11 10:00:03.520000 |
| 34127 | 1 | 4998 | 2018-10-11 10:00:05.042000 |
| 34128 | 1 | 4999 | 2018-10-11 10:00:08.667000 |
| 34129 | 1 | 4998 | 2018-10-11 10:00:09.521000 |
| 34130 | 1 | 4998 | 2018-10-11 10:00:11.097000 |
| 34131 | 1 | 4999 | 2018-10-11 10:00:12.059000 |
| 34132 | 1 | 4998 | 2018-10-11 10:00:15.240000 |
| 34133 | 1 | 4999 | 2018-10-11 10:00:18.119000 |
+-------+--------+-------+----------------------------+

USER
+------+--------------+-------+--------------------------------------------------------------+---------------------+
| id | bank_id | name | password | created_at |
+------+--------------+-------+--------------------------------------------------------------+---------------------+
| 1235 | jz67jt77rpnb | ?? ?? | $2a$04$6ieL8BBW6oiDZAYOmdgViOR/026O9JHw7diR342/RyEhMhRI9IhFm | 2018-10-11 10:00:00 |
| 1236 | 2z82n5q | ?? ? | $2a$04$K4tqCfXVxQ7BUtC4Rx9S.Odc2LfjrJkv7ShMy5pYWQTqYNkIcKCgK | 2018-10-11 10:00:00 |
| 1237 | k2vutw | ?? ?? | $2a$04$qVEokzg7aANtQIn.R13Va.1vRDghvI7ChVA0J9cGsY0yq3hlxvZA6 | 2018-10-11 10:00:01 |
| 1238 | yft3f5d5g | ?? ?? | $2a$04$24hSHJsvweeAx9CakOgume1YXxnBZTTGv2j0Z4mc41DJxH9wUM0za | 2018-10-11 10:00:01 |
| 1239 | pcsuktmvqn | ?? ?? | $2a$04$MpuJEh8nrSyMpuxe7lp2ruGmBMtEjMwJcQJf3gFbVVzd/12z5kl.O | 2018-10-11 10:00:03 |
| 1240 | hpnwwt | ?? ? | $2a$04$KyozK1u71Gwh2Plpxkriwu6vizkuIxHJ2LIXpX4rlAZi/tnAVGuO. | 2018-10-11 10:00:03 |
| 1241 | 2q5m84je | ?? ?? | $2a$04$WnjM0.FfU47PvpwVwwnbiO3wS3vf6kieiNVDwZJHCWaLTZGtF4jem | 2018-10-11 10:00:04 |
| 1242 | cymy39gqttm | ? ?? | $2a$04$SvScAwzL4kZQfYwu7.em6uGQg1hcxZMhk0aEFBZY97ILKAKOngE.K | 2018-10-11 10:00:04 |
| 1243 | 2e633gvuk8r | ?? ?? | $2a$04$D016sTFwcpsrLsV8DN5lqu.SRl/.YIHLzscaw4mMl6nxO0blETFK6 | 2018-10-11 10:00:08 |
| 1244 | qdyj7z5vj5 | ?? ?? | $2a$05$4nuH6tXyHkzNagtFyBJK9ubAhUKqE32EnOUo5PkYVTWtqdXP8aT8. | 2018-10-11 10:00:08 |
+------+--------------+-------+--------------------------------------------------------------+---------------------+

fetchone シリーズの削除

クエリを発行して1個取ってくるだけなら、そもそも全部もってくる必要は無さそう(予選みたいに落ちたら粘らず戻すこと)

  1. model/trades.pyの get_latast_trade(),get_trade_by_id()の内部で呼ばれている_get_trade()では、
    クエリを発行してたくさん列を得たあと、cur.fetchone()しているのでそもそも LIMIT 1的なことをすれば良い?

他のfetchoneを呼び出しているやつはLIMITがついている/複数の列が返らないクエリだったのでほかは良さそう

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.