Skip to content

Parallel loading on mli load #32

@5ouma

Description

@5ouma

✏️ Describe the feature

mli load takes a long time if there are many Login Items in login_items.json because Add() just loops the Login Items array ([]*loginItem).
So it should load parallelly to speed up.

mli/lib/oascript.go

Lines 46 to 59 in fd914ba

func (loginItems *LoginItems) Add() error {
for _, loginItem := range *loginItems {
if isExist, err := isExist(loginItem.Path); !isExist && err == nil {
fmt.Printf("⚠️ not found: \"%s\"\n", loginItem.Path)
continue
}
if _, err := mack.Tell("System Events", fmt.Sprintf(`make login item at end with properties { name: "%s", path: "%s", hidden: %v }`, loginItem.Name, loginItem.Path, loginItem.Hidden)); err != nil {
return err
}
fmt.Printf("🔍 %s\n", loginItem.Name)
}
return nil
}

✔︎ Confirm these checks

🗒️ Additional Information

No response

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions