MCPcopy Index your code
hub / github.com/MALSync/MALSync / syncList

Function syncList

src/utils/syncHandler.ts:174–200  ·  view source on GitHub ↗
(list, thisMissing)

Source from the content-addressed store, hash-verified

172// Sync
173
174export async function syncList(list, thisMissing) {
175 for (const i in list) {
176 const el = list[i];
177 if (el.diff) {
178 try {
179 await syncListItem(el);
180 el.diff = false;
181 } catch (e) {
182 con.error(e);
183 }
184 }
185 }
186
187 const missing = thisMissing.slice();
188 for (const i in missing) {
189 const miss = missing[i];
190 con.log('Sync missing', miss);
191 await syncMissing(miss)
192 .then(() => {
193 thisMissing.splice(thisMissing.indexOf(miss), 1);
194 })
195 .catch(e => {
196 con.error('Error', e);
197 miss.error = e;
198 });
199 }
200}
201
202export async function syncListItem(item) {
203 for (let i = 0; i < item.slaves.length; i++) {

Callers 1

syncListsFunction · 0.70

Calls 3

syncListItemFunction · 0.85
syncMissingFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected