<commit_before>import {RootStore} from './RootStore'
import {RundeckClient} from '@rundeck/client'
import { action, computed, flow, observable } from 'mobx'
import { ProjectListOKResponseItem, ProjectListResponse } from '@rundeck/client/dist/lib/models'


export class ProjectStore {
    @observable projects: Array<Project> = []

    constructor(readonly root: RootStore, readonly client: RundeckClient) {}

    @observable loaded = false

    load = flow(function* (this: ProjectStore) {
        if (this.loaded)
            return

        this.projects = []
        const resp = (yield this.client.projectList()) as ProjectListResponse
        yield new Promise(res => {setTimeout(res, 1000)})
        resp.forEach(p => {
            this.projects.push(Project.FromApi(p))
        })
        this.loaded = true
    })

    search(term: string) {
        const lowerTerm = term.toLowerCase()
        return this.projects.filter(p => {
            const pTerm = p.label || p.name
            return pTerm.toLowerCase().includes(lowerTerm)
        })
    }
}

<commit_msg>#7116 Remove 1 second timeout for request<commit_after>import {RootStore} from './RootStore'
import {RundeckClient} from '@rundeck/client'
import { action, computed, flow, observable } from 'mobx'
import { ProjectListOKResponseItem, ProjectListResponse } from '@rundeck/client/dist/lib/models'


export class ProjectStore {
    @observable projects: Array<Project> = []

    constructor(readonly root: RootStore, readonly client: RundeckClient) {}

    @observable loaded = false

    load = flow(function* (this: ProjectStore) {
        if (this.loaded)
            return

        this.projects = []
        const resp = (yield this.client.projectList()) as ProjectListResponse
        yield new Promise(res => {setTimeout(res, 0)})
        resp.forEach(p => {
            this.projects.push(Project.FromApi(p))
        })
        this.loaded = true
    })

    search(term: string) {
        const lowerTerm = term.toLowerCase()
        return this.projects.filter(p => {
            const pTerm = p.label || p.name
            return pTerm.toLowerCase().includes(lowerTerm)
        })
    }
}


{'fraction_non_alphanumeric': 0.11653615845232612, 'fraction_numerical': 0.004606172270842929, 'mean_word_length': 2.738382099827883, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5011747', 'n_tokens_mistral': 627, 'n_tokens_neox': 597, 'n_words': 148}