| 114 | |
| 115 | @dataclass |
| 116 | class Update_Input(): |
| 117 | session: Any |
| 118 | input_list: list = None |
| 119 | |
| 120 | """ |
| 121 | |
| 122 | Mainly focused around Retrying |
| 123 | |
| 124 | Expecting this could get a lot more complex in the future |
| 125 | |
| 126 | TODO |
| 127 | Consider what retrys are allowed, |
| 128 | ie requiring URL or some way to re access it |
| 129 | |
| 130 | What other informatino should be stored? |
| 131 | ie should the timestamp change, or some other record of it being |
| 132 | retried? some benefits to not changing some of info |
| 133 | |
| 134 | What checks are we doing for stuff, |
| 135 | ie I am hardpressed to see when we would need |
| 136 | to retry a success case? |
| 137 | |
| 138 | Can we use this for some form of input or config testing? |
| 139 | sometimes the input stuff can be complex, |
| 140 | |
| 141 | It creates it's own log, just for this process right? |
| 142 | |
| 143 | |
| 144 | """ |
| 145 | |
| 146 | def __post_init__(self): |
| 147 | self.log = regular_log.default() |
| 148 | |
| 149 | def retry_file_list(self): |
| 150 | |
| 151 | for input in self.input_list: |
| 152 | self.input = input |
| 153 | self.retry_file() |
| 154 | |
| 155 | def retry_file(self): |
| 156 | """ |
| 157 | |
| 158 | 1) Marks existing file as "removed" |
| 159 | 2) Sets processing deferred on input to True |
| 160 | 3) Resets status |
| 161 | |
| 162 | TODO limits, |
| 163 | * ie do we allow retry of "split" videos, |
| 164 | and if so does that need to follow different |
| 165 | process |
| 166 | * ... |
| 167 | |
| 168 | """ |
| 169 | |
| 170 | if self.input.mode != "update": |
| 171 | # Important. Context of updates not creating a new file, so not wanting to |
| 172 | # remove original file. |
| 173 | self.remove_associated_file(self.input) |
no outgoing calls
no test coverage detected