mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt some
This commit is contained in:
parent
782eccd4d0
commit
29539c492c
@ -92,7 +92,6 @@ func _cache_download(m *ice.Message, r *http.Response) (file, size string) {
|
|||||||
f.Write(buf[0:n])
|
f.Write(buf[0:n])
|
||||||
s := size * 100 / total
|
s := size * 100 / total
|
||||||
|
|
||||||
m.Debug("what %v", kit.FileLine(m.OptionCB(SPIDE), 3))
|
|
||||||
switch cb := m.OptionCB(SPIDE).(type) {
|
switch cb := m.OptionCB(SPIDE).(type) {
|
||||||
case func(int, int):
|
case func(int, int):
|
||||||
cb(size, total)
|
cb(size, total)
|
||||||
@ -103,6 +102,9 @@ func _cache_download(m *ice.Message, r *http.Response) (file, size string) {
|
|||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
if s != step && s%10 == 0 {
|
if s != step && s%10 == 0 {
|
||||||
|
m.Debug("what %v", m.OptionCB(SPIDE))
|
||||||
|
m.Debug("what %v", m.OptionCB(SPIDE))
|
||||||
|
m.Debug("what %v", kit.FileLine(m.OptionCB(SPIDE), 3))
|
||||||
m.Log_IMPORT(kit.MDB_FILE, p, kit.MDB_STEP, s,
|
m.Log_IMPORT(kit.MDB_FILE, p, kit.MDB_STEP, s,
|
||||||
kit.MDB_SIZE, kit.FmtSize(int64(size)), kit.MDB_TOTAL, kit.FmtSize(int64(total)))
|
kit.MDB_SIZE, kit.FmtSize(int64(size)), kit.MDB_TOTAL, kit.FmtSize(int64(total)))
|
||||||
}
|
}
|
||||||
|
2
misc.go
2
misc.go
@ -103,7 +103,7 @@ func (m *Message) FieldsIsDetail() bool {
|
|||||||
}
|
}
|
||||||
func (m *Message) OptionCB(key string, cb ...interface{}) interface{} {
|
func (m *Message) OptionCB(key string, cb ...interface{}) interface{} {
|
||||||
if len(cb) > 0 {
|
if len(cb) > 0 {
|
||||||
return m.Optionv(kit.Keycb(key), cb)
|
return m.Optionv(kit.Keycb(key), cb...)
|
||||||
}
|
}
|
||||||
return m.Optionv(kit.Keycb(key))
|
return m.Optionv(kit.Keycb(key))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user