GithubHelp home page GithubHelp logo

Comments (5)

medasz avatar medasz commented on July 19, 2024

这样会不会导致数据库中的ip有的会过期

from proxypool.

sndnvaps avatar sndnvaps commented on July 19, 2024

这个操作会10分钟进行一次,即10分钟会Fetch一次,网站上的数据。再更新到数据库中。如果你有更好的想法,可以提交pr

from proxypool.

medasz avatar medasz commented on July 19, 2024

我只是有一些地方想不通,不是说你写的不好
数据库会不会有一直更新不到的数据;
我想改成

go func() {
		for{
			storage.CheckProxyDB()
		}
	}()

还有一点不太明白:在CheckIP的时候有更新,为什么还要在添加,难道更新的时候数据如果不存在不会插入吗?

from proxypool.

sndnvaps avatar sndnvaps commented on July 19, 2024

我只是有一些地方想不通,不是说你写的不好
数据库会不会有一直更新不到的数据;
我想改成

go func() {
		for{
			storage.CheckProxyDB()
		}
	}()

还有一点不太明白:在CheckIP的时候有更新,为什么还要在添加,难道更新的时候数据如果不存在不会插入吗?
即当原来数据库中数据不存在的时候,是会插入的,如果存在就会考虑更新数据库。
可能会存在一些逻辑问题的,你可以尝试修复一下。现在我测试上也存在一些问题,部分数据无法更新到,所以对mysql的表进行了限制,即ip字段进行了unique限制,即每个ip:port只能插入一次。。。
参考行号 https://github.com/henson/proxypool/blob/master/pkg/models/ip.go#L11

from proxypool.

medasz avatar medasz commented on July 19, 2024

好的,明白了。谢谢解答疑惑^_^

from proxypool.

Related Issues (20)

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.