diff options
author | Kostyantyn Ovechko <fastinetserver@gmail.com> | 2010-08-16 18:20:21 +0300 |
---|---|---|
committer | Kostyantyn Ovechko <fastinetserver@gmail.com> | 2010-08-16 18:20:21 +0300 |
commit | 2fbb6cb937b69e0b5b00f95fafbb4b9bd11ceb12 (patch) | |
tree | af6275b562407c3ef188a4367cabae7c18db0250 | |
parent | Erase deprecated lines in Makefile files (diff) | |
download | idfetch-2fbb6cb937b69e0b5b00f95fafbb4b9bd11ceb12.tar.gz idfetch-2fbb6cb937b69e0b5b00f95fafbb4b9bd11ceb12.tar.bz2 idfetch-2fbb6cb937b69e0b5b00f95fafbb4b9bd11ceb12.zip |
Move example from net0.py to net0_example.py
-rw-r--r-- | seggetd/scripts/net0.py | 13 | ||||
-rw-r--r-- | seggetd/scripts/net0_example.py | 15 |
2 files changed, 16 insertions, 12 deletions
diff --git a/seggetd/scripts/net0.py b/seggetd/scripts/net0.py index 8d87955..7d604c1 100644 --- a/seggetd/scripts/net0.py +++ b/seggetd/scripts/net0.py @@ -1,15 +1,4 @@ from functions import * import time; def schedule(): - localtime = time.localtime(time.time()); - hour=localtime[3]; - # disable downloading distfiles that have size more than 5 000 000 bytes - # from 8-00 to 22-00. - if hour>8 and hour<21 and (get("distfile.size"))>5000000: - print "reject because distfile is too big" - reject_segment() - # set speed limit 50 000 cps for distfiles larger than 1 000 000 bytes - if get("distfile.size")>1000000: - print "limit connection speed" - set(connection.max_speed_limit, 50000) - accept_segment()
\ No newline at end of file + accept_segment()
\ No newline at end of file diff --git a/seggetd/scripts/net0_example.py b/seggetd/scripts/net0_example.py new file mode 100644 index 0000000..8d87955 --- /dev/null +++ b/seggetd/scripts/net0_example.py @@ -0,0 +1,15 @@ +from functions import * +import time; +def schedule(): + localtime = time.localtime(time.time()); + hour=localtime[3]; + # disable downloading distfiles that have size more than 5 000 000 bytes + # from 8-00 to 22-00. + if hour>8 and hour<21 and (get("distfile.size"))>5000000: + print "reject because distfile is too big" + reject_segment() + # set speed limit 50 000 cps for distfiles larger than 1 000 000 bytes + if get("distfile.size")>1000000: + print "limit connection speed" + set(connection.max_speed_limit, 50000) + accept_segment()
\ No newline at end of file |