[SteemSQL Wrapper] Fixed and optimized the delay info by emptyname

View this thread on steempeak.com
· @emptyname · (edited)
$99.13
[SteemSQL Wrapper] Fixed and optimized the delay info
The last few days [SteemSQL Wrapper](https://sql.steemhelpers.com) had some problems with displaying the delay — it just did not load and SteemSQL Wrapper always displays `Delay: loading...`, if you did use API then you were getting `504 Gateway Time-out`.

It was caused because of steemd.steemit.com [was deprecated](https://steemit.com/steemitdev/@steemitdev/last-chance-to-update-steemd-steemit-com-will-be-retired-on-january-6) on 6th of January. I used steem-python to get the last block from the blockchain but it uses steemd as a default node. This problem can be easily solved by setting [a custom node](https://www.steem.center/index.php?title=Public_Websocket_Servers). But while I did search a reason for the problem, I decided full remove steem-python from the project.

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515507776/ndevf350elk7fbp71rsx.png)

In fact, it was a bad solution — checking the time of the last block in SteemSQL and comparing it with current time is enough because Steem gets a new block every 3 seconds.

A quotation from the White Paper:
> Because the active witnesses are known in advance, Steem is able to schedule witnesses to produce blocks every 3 seconds.

So now this part of the project is optimized and now you can get the delay info faster.

[Commit](https://github.com/sihaelov/steemsql-wrapper/commit/cdd4bb409b782cc40e236c35f614fcafb6f40cd6)

![image](https://steemit-production-imageproxy-thumbnail.s3.amazonaws.com/U5dtgf6jjoQQJeK4B9jSWsNxkYFrzQo_1680x8400)

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@emptyname/steemsql-wrapper-fixed-and-optimized-the-delay-info">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id24,588,997
authoremptyname
permlinksteemsql-wrapper-fixed-and-optimized-the-delay-info
categoryutopian-io
json_metadata"{"repository": {"owner": {"login": "sihaelov"}, "id": 114453017, "full_name": "sihaelov/steemsql-wrapper", "fork": false, "name": "steemsql-wrapper", "html_url": "https://github.com/sihaelov/steemsql-wrapper"}, "moderator": {"flagged": false, "account": "vladimir-simovic", "reviewed": true, "pending": false}, "format": "markdown", "platform": "github", "tags": ["utopian-io", "steemit", "steem", "stats", "steemdev"], "community": "utopian", "type": "development", "pullRequests": [], "links": ["https://sql.steemhelpers.com", "https://steemit.com/steemitdev/@steemitdev/last-chance-to-update-steemd-steemit-com-will-be-retired-on-january-6", "https://www.steem.center/index.php?title=Public_Websocket_Servers", "https://res.cloudinary.com/hpiynhbhq/image/upload/v1515507776/ndevf350elk7fbp71rsx.png", "https://github.com/sihaelov/steemsql-wrapper/commit/cdd4bb409b782cc40e236c35f614fcafb6f40cd6", "https://steemit-production-imageproxy-thumbnail.s3.amazonaws.com/U5dtgf6jjoQQJeK4B9jSWsNxkYFrzQo_1680x8400"], "app": "utopian/1.0.0", "users": ["steemitdev", "emptyname"], "image": ["https://res.cloudinary.com/hpiynhbhq/image/upload/v1515507776/ndevf350elk7fbp71rsx.png"]}"
created2018-01-09 14:19:42
last_update2018-01-11 11:35:45
depth0
children3
net_rshares11,177,461,435,565
last_payout2018-01-16 14:19:42
cashout_time1969-12-31 23:59:59
total_payout_value69.612 SBD
curator_payout_value29.521 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,721
author_reputation7,007,378,164,906
root_title"[SteemSQL Wrapper] Fixed and optimized the delay info"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (35)
@vladimir-simovic ·
$0.03
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
👍  
properties (23)
post_id24,977,622
authorvladimir-simovic
permlinkre-emptyname-steemsql-wrapper-fixed-and-optimized-the-delay-info-20180111t095249141z
categoryutopian-io
json_metadata"{"app": "utopian/1.0.0", "community": "utopian", "tags": ["utopian-io"]}"
created2018-01-11 09:52:48
last_update2018-01-11 09:52:48
depth1
children1
net_rshares3,869,013,313
last_payout2018-01-18 09:52:48
cashout_time1969-12-31 23:59:59
total_payout_value0.024 SBD
curator_payout_value0.004 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length172
author_reputation56,522,611,888,290
root_title"[SteemSQL Wrapper] Fixed and optimized the delay info"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@emptyname ·
Thanks!
properties (22)
post_id24,994,760
authoremptyname
permlinkre-vladimir-simovic-re-emptyname-steemsql-wrapper-fixed-and-optimized-the-delay-info-20180111t114229285z
categoryutopian-io
json_metadata"{"app": "steemit/0.1", "tags": ["utopian-io"]}"
created2018-01-11 11:42:30
last_update2018-01-11 11:42:30
depth2
children0
net_rshares0
last_payout2018-01-18 11:42:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length7
author_reputation7,007,378,164,906
root_title"[SteemSQL Wrapper] Fixed and optimized the delay info"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@utopian-io ·
### Hey @emptyname I am @utopian-io. I have just upvoted you!
#### Achievements
- You have less than 500 followers. Just gave you a gift to help you succeed!
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
post_id25,211,901
authorutopian-io
permlinkre-emptyname-steemsql-wrapper-fixed-and-optimized-the-delay-info-20180112t113933588z
categoryutopian-io
json_metadata"{"app": "utopian/1.0.0", "community": "utopian", "tags": ["utopian-io"]}"
created2018-01-12 11:39:33
last_update2018-01-12 11:39:33
depth1
children0
net_rshares0
last_payout2018-01-19 11:39:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,085
author_reputation152,913,012,544,965
root_title"[SteemSQL Wrapper] Fixed and optimized the delay info"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000