Close stops GraphJin background tasks. It is safe to call multiple times.
()
| 303 | |
| 304 | // Close stops GraphJin background tasks. It is safe to call multiple times. |
| 305 | func (g *GraphJin) Close() { |
| 306 | if g == nil || g.done == nil { |
| 307 | return |
| 308 | } |
| 309 | |
| 310 | g.stopOnce.Do(func() { |
| 311 | close(g.done) |
| 312 | }) |
| 313 | } |
| 314 | |
| 315 | // newGraphJinWithDBInfo creates the GraphJin struct, this involves querying the database to learn its |
| 316 | // it all starts here |