daemon/status.bend checks
raw source on the hub · import cswap-bend-cli@0.1.0.0/daemon/status.bend as Status
6 imports
import Base import ../json.bend as Json import ../fs.bend as Fs import ../fs/write.bend as FsW import ../act.bend as Act import ./config.bend as Cfg
Types
type Entry source · line 15 · raw
Data
Entry@slot:String -> @pct5:Maybe<&2, U32> -> @pct7:Maybe<&2, U32> -> @fetched_at:Maybe<&2, String> -> @backoff_until:Maybe<&2, String> -> @last_error:Maybe<&2, String> -> Entry
type Status source · line 18 · raw
Data
Status@pid:U32 -> @version:String -> @started_at:String -> @last_poll_at:Maybe<&2, String> -> @next_poll_at:Maybe<&2, String> -> @active:Maybe<&2, String> -> @entries:List<&2, Entry> -> @cfg:0x0717344745a30ebad1f19045228e8f18/daemon/config.Cfg -> Status
Definitions
def status_path source · line 21 · raw
@+state_dir:String -> String
def pick_s source · line 24 · raw
@+c:Bool -> @+x:String -> @+y:String -> String
def two source · line 31 · raw
@+n:U32 -> String
def frac source · line 34 · raw
@+c:U32 -> String
def pct source · line 37 · raw
@+c:U32 -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def opt_pct source · line 40 · raw
@+m:Maybe<&2, U32> -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def opt_str source · line 47 · raw
@+m:Maybe<&2, String> -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def f source · line 54 · raw
@+k:String -> @+v:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+rest:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def entry_json source · line 57 · raw
@e:Entry -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def entry_slot source · line 62 · raw
@e:Entry -> String
def entries_chain source · line 67 · raw
@+es:List<&2, Entry> -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def opt_num source · line 74 · raw
@+m:Maybe<&2, String> -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def str_arr source · line 81 · raw
@+xs:List<&2, String> -> List<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json>
def cfg_json source · line 88 · raw
@+c:0x0717344745a30ebad1f19045228e8f18/daemon/config.Cfg -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def to_json source · line 92 · raw
@s:Status -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def write source · line 99 · raw
@+state_dir:String -> @s:Status -> 0x0717344745a30ebad1f19045228e8f18/act.of(Unit)
Replace the status file (temp file + rename, 0600).