Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel loading on mli load #32

Open
3 tasks done
5ouma opened this issue Jan 22, 2024 · 0 comments
Open
3 tasks done

Parallel loading on mli load #32

5ouma opened this issue Jan 22, 2024 · 0 comments
Assignees
Labels
🎉 New Feature Introduce a new feature 🏎️ Performance A code change that improves performance

Comments

@5ouma
Copy link
Owner

5ouma commented Jan 22, 2024

✏️ 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

@5ouma 5ouma self-assigned this Jan 22, 2024
@5ouma 5ouma added 🏎️ Performance A code change that improves performance 🎉 New Feature Introduce a new feature and removed Type: Feature labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 New Feature Introduce a new feature 🏎️ Performance A code change that improves performance
Projects
None yet
Development

No branches or pull requests

1 participant