Skip to content

Comments

New position weight updater#18

Open
chazeon wants to merge 5 commits intoGlaceon31:masterfrom
chazeon:new-position-weight-updater
Open

New position weight updater#18
chazeon wants to merge 5 commits intoGlaceon31:masterfrom
chazeon:new-position-weight-updater

Conversation

@chazeon
Copy link
Collaborator

@chazeon chazeon commented Sep 30, 2017

Use maps from a.llsif.win/live/json/ to avoid using of the unmaintainable old and problematic weight updater.

Write a position weight updater that fetches data from a.llsif.win/live/json.
Continuing even when error is encountered
Add 0.5 factor for swing notes
@chazeon chazeon closed this Sep 30, 2017
Rewriting most of the multiprocessing part of the weight updater, adding introduction title and other info logs to it
@chazeon chazeon reopened this Oct 1, 2017
Copy link
Collaborator

@liaocm liaocm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general LGTM, but please consider the comments before merging.

-liaocm


def getLiveMap(liveId):
liveJsonUrl = getLiveMapJsonUrl(liveId)
liveJsonFp = urllib2.urlopen(liveJsonUrl)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the request header contains good UA, Accept, Accept-Language, and Accept-Encoding field. Otherwise this may be flaky (happened to my auto upgrade script.)

Also, consider using gzip encoding here as it would dramatically reduce load latency. Using 'gzip' library will easily decode the response.

prevLoadedLives = []
updatedLives = []

messageQueue = multiprocessing.Queue()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to multi-process the fetching process? Every update contains only a few new maps and multithreaded code is super hard to read and maintain.

chazeon referenced this pull request in chazeon/LLHelper Apr 22, 2018
Refactor attribute strength calculation in llnewunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants